diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-04-18 21:03:21 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-04-18 21:03:21 -0400 |
commit | f2c1e9ddd40573f4b44ffc2ec7df1fb76346f627 (patch) | |
tree | da477a9e67e16339267ee0946c3b253c612c7bbf /tmk_core | |
parent | d94960be5b32b6a4019b822550ae09cf802bfcd7 (diff) | |
parent | 499e3096e9021b88a6a705ad7034ccbacb97b975 (diff) |
Merge pull request #262 from IBNobody/master
Fixed keyboard snoring while asleep
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/avr/suspend.c | 12 | ||||
-rw-r--r-- | tmk_core/common/command.c | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index c07c2801d5..e295dbe18b 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,10 @@ static void power_down(uint8_t wdto) // 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 diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 7572b95979..f06abaf7f0 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -49,6 +49,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # include "usbdrv.h" #endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif /* AUDIO_ENABLE */ + static bool command_common(uint8_t code); static void command_common_help(void); @@ -352,6 +356,9 @@ static bool command_common(uint8_t code) case MAGIC_KC(MAGIC_KEY_BOOTLOADER): clear_keyboard(); // clear to prevent stuck keys print("\n\nJumping to bootloader... "); + #ifdef AUDIO_ENABLE + play_goodbye_tone(); + #endif _delay_ms(1000); bootloader_jump(); // not return break; |