summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/action.c8
-rw-r--r--tmk_core/common/action_layer.c8
-rw-r--r--tmk_core/common/action_macro.c8
-rw-r--r--tmk_core/common/action_tapping.c8
-rw-r--r--tmk_core/common/avr/eeconfig.c30
-rw-r--r--tmk_core/common/avr/suspend.c3
-rw-r--r--tmk_core/common/backlight.c10
-rw-r--r--tmk_core/common/bootmagic.c6
-rw-r--r--tmk_core/common/eeconfig.h10
9 files changed, 46 insertions, 45 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 0162fbd632..f9e6c17dc3 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -27,11 +27,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "action_util.h"
#include "action.h"
-//#ifdef DEBUG_ACTION
+#ifdef DEBUG_ACTION
#include "debug.h"
-//#else
-//#include "nodebug.h"
-//#endif
+#else
+#include "nodebug.h"
+#endif
void action_exec(keyevent_t event)
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index 845fbbb210..63fa2b5ae4 100644
--- a/tmk_core/common/action_layer.c
+++ b/tmk_core/common/action_layer.c
@@ -4,11 +4,11 @@
#include "util.h"
#include "action_layer.h"
-//#ifdef DEBUG_ACTION
+#ifdef DEBUG_ACTION
#include "debug.h"
-//#else
-//#include "nodebug.h"
-//#endif
+#else
+#include "nodebug.h"
+#endif
/*
diff --git a/tmk_core/common/action_macro.c b/tmk_core/common/action_macro.c
index cc78c82327..7726b11907 100644
--- a/tmk_core/common/action_macro.c
+++ b/tmk_core/common/action_macro.c
@@ -19,11 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "action_macro.h"
#include "wait.h"
-//#ifdef DEBUG_ACTION
+#ifdef DEBUG_ACTION
#include "debug.h"
-//#else
-//#include "nodebug.h"
-//#endif
+#else
+#include "nodebug.h"
+#endif
#ifndef NO_ACTION_MACRO
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index 6b6fa1dfe2..e6343e6da7 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -6,11 +6,11 @@
#include "keycode.h"
#include "timer.h"
-//#ifdef DEBUG_ACTION
+#ifdef DEBUG_ACTION
#include "debug.h"
-//#else
-//#include "nodebug.h"
-//#endif
+#else
+#include "nodebug.h"
+#endif
#ifndef NO_ACTION_TAPPING
diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c
index 25bb9e849c..c5391f5cf5 100644
--- a/tmk_core/common/avr/eeconfig.c
+++ b/tmk_core/common/avr/eeconfig.c
@@ -5,27 +5,27 @@
void eeconfig_init(void)
{
- eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
- eeprom_write_byte(EECONFIG_DEBUG, 0);
- eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0);
- eeprom_write_byte(EECONFIG_KEYMAP, 0);
- eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
+ eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
+ eeprom_update_byte(EECONFIG_DEBUG, 0);
+ eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0);
+ eeprom_update_byte(EECONFIG_KEYMAP, 0);
+ eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
#ifdef BACKLIGHT_ENABLE
- eeprom_write_byte(EECONFIG_BACKLIGHT, 0);
+ eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
#endif
#ifdef AUDIO_ENABLE
- eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default
+ eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
#endif
}
void eeconfig_enable(void)
{
- eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
+ eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
}
void eeconfig_disable(void)
{
- eeprom_write_word(EECONFIG_MAGIC, 0xFFFF);
+ eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
}
bool eeconfig_is_enabled(void)
@@ -34,20 +34,20 @@ bool eeconfig_is_enabled(void)
}
uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
-void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); }
+void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
-void eeconfig_write_default_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); }
+void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
-void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); }
+void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
#ifdef BACKLIGHT_ENABLE
uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
-void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); }
+void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
#endif
#ifdef AUDIO_ENABLE
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
-void eeconfig_write_audio(uint8_t val) { eeprom_write_byte(EECONFIG_AUDIO, val); }
-#endif \ No newline at end of file
+void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
+#endif
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index e295dbe18b..4980680198 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -79,7 +79,8 @@ static void power_down(uint8_t wdto)
led_set(0);
#ifdef AUDIO_ENABLE
- stop_all_notes();
+ // This sometimes disables the start-up noise, so it's been disabled
+ // stop_all_notes();
#endif /* AUDIO_ENABLE */
// TODO: more power saving
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index 558ad9b014..2f6fc1cd6c 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -37,7 +37,7 @@ void backlight_increase(void)
{
backlight_config.level++;
backlight_config.enable = 1;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
}
dprintf("backlight increase: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
@@ -49,7 +49,7 @@ void backlight_decrease(void)
{
backlight_config.level--;
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
}
dprintf("backlight decrease: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
@@ -58,7 +58,7 @@ void backlight_decrease(void)
void backlight_toggle(void)
{
backlight_config.enable ^= 1;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
dprintf("backlight toggle: %u\n", backlight_config.enable);
backlight_set(backlight_config.enable ? backlight_config.level : 0);
}
@@ -71,7 +71,7 @@ void backlight_step(void)
backlight_config.level = 0;
}
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
dprintf("backlight step: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
}
@@ -80,6 +80,6 @@ void backlight_level(uint8_t level)
{
backlight_config.level ^= level;
backlight_config.enable = !!backlight_config.level;
- eeconfig_write_backlight(backlight_config.raw);
+ eeconfig_update_backlight(backlight_config.raw);
backlight_set(backlight_config.level);
}
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index b002a58562..2c1b1adfc5 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -52,7 +52,7 @@ void bootmagic(void)
debug_config.enable = !debug_config.enable;
}
}
- eeconfig_write_debug(debug_config.raw);
+ eeconfig_update_debug(debug_config.raw);
/* keymap config */
keymap_config.raw = eeconfig_read_keymap();
@@ -80,7 +80,7 @@ void bootmagic(void)
if (bootmagic_scan_keycode(BOOTMAGIC_HOST_NKRO)) {
keymap_config.nkro = !keymap_config.nkro;
}
- eeconfig_write_keymap(keymap_config.raw);
+ eeconfig_update_keymap(keymap_config.raw);
#ifdef NKRO_ENABLE
keyboard_nkro = keymap_config.nkro;
@@ -97,7 +97,7 @@ void bootmagic(void)
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_6)) { default_layer |= (1<<6); }
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { default_layer |= (1<<7); }
if (default_layer) {
- eeconfig_write_default_layer(default_layer);
+ eeconfig_update_default_layer(default_layer);
default_layer_set((uint32_t)default_layer);
} else {
default_layer = eeconfig_read_default_layer();
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index ddefca1347..ca47e0d2fd 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -60,22 +60,22 @@ void eeconfig_enable(void);
void eeconfig_disable(void);
uint8_t eeconfig_read_debug(void);
-void eeconfig_write_debug(uint8_t val);
+void eeconfig_update_debug(uint8_t val);
uint8_t eeconfig_read_default_layer(void);
-void eeconfig_write_default_layer(uint8_t val);
+void eeconfig_update_default_layer(uint8_t val);
uint8_t eeconfig_read_keymap(void);
-void eeconfig_write_keymap(uint8_t val);
+void eeconfig_update_keymap(uint8_t val);
#ifdef BACKLIGHT_ENABLE
uint8_t eeconfig_read_backlight(void);
-void eeconfig_write_backlight(uint8_t val);
+void eeconfig_update_backlight(uint8_t val);
#endif
#ifdef AUDIO_ENABLE
uint8_t eeconfig_read_audio(void);
-void eeconfig_write_audio(uint8_t val);
+void eeconfig_update_audio(uint8_t val);
#endif
#endif