]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/avr/suspend.c
Merge pull request #790 from IBNobody/master
[qmk_firmware.git] / tmk_core / common / avr / suspend.c
index caf0b0625461c91a14c85b7e2d825029e14cb6a3..8a7272bbc5298612bc935f51116d5e44973cddf2 100644 (file)
@@ -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,17 @@ 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
+        // 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
@@ -103,7 +117,7 @@ bool suspend_wakeup_condition(void)
     for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
         if (matrix_get_row(r)) return true;
     }
-    return false;
+     return false;
 }
 
 // run immediately after wakeup
@@ -132,4 +146,3 @@ ISR(WDT_vect)
     }
 }
 #endif
-