summaryrefslogtreecommitdiff
path: root/tmk_core/common/avr
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/avr')
-rw-r--r--tmk_core/common/avr/eeconfig.c8
-rw-r--r--tmk_core/common/avr/suspend.c17
2 files changed, 23 insertions, 2 deletions
diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c
index 5bd47dc6a..25bb9e849 100644
--- a/tmk_core/common/avr/eeconfig.c
+++ b/tmk_core/common/avr/eeconfig.c
@@ -13,6 +13,9 @@ void eeconfig_init(void)
#ifdef BACKLIGHT_ENABLE
eeprom_write_byte(EECONFIG_BACKLIGHT, 0);
#endif
+#ifdef AUDIO_ENABLE
+ eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default
+#endif
}
void eeconfig_enable(void)
@@ -43,3 +46,8 @@ void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val
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); }
#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
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index caf0b0625..e295dbe18 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__ ( \
@@ -66,9 +72,16 @@ static void power_down(uint8_t wdto)
wdt_intr_enable(wdto);
#ifdef BACKLIGHT_ENABLE
-backlight_set(0);
+ backlight_set(0);
#endif
+ // Turn off LED indicators
+ led_set(0);
+
+ #ifdef AUDIO_ENABLE
+ stop_all_notes();
+ #endif /* AUDIO_ENABLE */
+
// TODO: more power saving
// See PicoPower application note
// - I/O port input with pullup