]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/avr/suspend.c
Zeal60/Zeal65/M60-A implementation (#3879)
[qmk_firmware.git] / tmk_core / common / avr / suspend.c
index d7a7f049c7854748b24aa81cd002170a22bde0a6..5bca64685493609d9046fdadc359aca147e1094b 100644 (file)
@@ -56,6 +56,24 @@ void suspend_idle(uint8_t time)
     sleep_disable();
 }
 
+
+// TODO: This needs some cleanup
+
+/** \brief Run keyboard level Power down
+ *
+ * FIXME: needs doc
+ */
+__attribute__ ((weak))
+void suspend_power_down_user (void) { }
+/** \brief Run keyboard level Power down
+ *
+ * FIXME: needs doc
+ */
+__attribute__ ((weak))
+void suspend_power_down_kb(void) {
+  suspend_power_down_user();
+}
+
 #ifndef NO_SUSPEND_POWER_DOWN
 /** \brief Power down MCU with watchdog timer
  *
@@ -73,21 +91,6 @@ void suspend_idle(uint8_t time)
  */
 static uint8_t wdt_timeout = 0;
 
-/** \brief Run keyboard level Power down
- *
- * FIXME: needs doc
- */
-__attribute__ ((weak))
-void suspend_power_down_user (void) { }
-/** \brief Run keyboard level Power down
- *
- * FIXME: needs doc
- */
-__attribute__ ((weak))
-void suspend_power_down_kb(void) {
-  suspend_power_down_user();
-}
-
 /** \brief Power down
  *
  * FIXME: needs doc
@@ -144,6 +147,8 @@ static void power_down(uint8_t wdto)
  */
 void suspend_power_down(void)
 {
+       suspend_power_down_kb();
+
 #ifndef NO_SUSPEND_POWER_DOWN
     power_down(WDTO_15MS);
 #endif
@@ -198,7 +203,7 @@ void suspend_wakeup_init(void)
   rgblight_timer_enable();
 #endif
 #endif
-  suspend_wakeup_init_kb();
+    suspend_wakeup_init_kb();
 }
 
 #ifndef NO_SUSPEND_POWER_DOWN