summaryrefslogtreecommitdiff
path: root/tmk_core/common/avr
diff options
context:
space:
mode:
authorOlivier <olivier@gid0.org>2016-04-30 16:03:52 +0200
committerOlivier <olivier@gid0.org>2016-04-30 16:03:52 +0200
commit09ea12f9ca96fa89a500a5965bf074c4347d300d (patch)
tree747caedcbd529d068d6794a72e65a5bef274ed8e /tmk_core/common/avr
parent9d48ba9713d17a8ebae99ef42bc7838402fc532f (diff)
parente7d56215deb253b44b190d12288076d03b206bdf (diff)
Merge https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'tmk_core/common/avr')
-rw-r--r--tmk_core/common/avr/eeconfig.c30
-rw-r--r--tmk_core/common/avr/suspend.c13
2 files changed, 27 insertions, 16 deletions
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 c07c2801d5..4980680198 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -9,10 +9,16 @@
#include "suspend.h"
#include "timer.h"
#include "led.h"
+
#ifdef PROTOCOL_LUFA
-#include "lufa.h"
+ #include "lufa.h"
#endif
+#ifdef AUDIO_ENABLE
+ #include "audio.h"
+#endif /* AUDIO_ENABLE */
+
+
#define wdt_intr_enable(value) \
__asm__ __volatile__ ( \
@@ -72,6 +78,11 @@ static void power_down(uint8_t wdto)
// Turn off LED indicators
led_set(0);
+ #ifdef AUDIO_ENABLE
+ // This sometimes disables the start-up noise, so it's been disabled
+ // stop_all_notes();
+ #endif /* AUDIO_ENABLE */
+
// TODO: more power saving
// See PicoPower application note
// - I/O port input with pullup