8 #include "action_util.h"
11 #include "backlight.h"
15 /** \brief suspend idle
19 void suspend_idle(uint8_t time) {
20 // TODO: this is not used anywhere - what units is 'time' in?
24 /** \brief Run keyboard level Power down
28 __attribute__ ((weak))
29 void suspend_power_down_user (void) { }
30 /** \brief Run keyboard level Power down
34 __attribute__ ((weak))
35 void suspend_power_down_kb(void) {
36 suspend_power_down_user();
39 /** \brief suspend power down
43 void suspend_power_down(void) {
44 // TODO: figure out what to power down and how
45 // shouldn't power down TPM/FTM if we want a breathing LED
46 // also shouldn't power down USB
48 suspend_power_down_kb();
49 // on AVR, this enables the watchdog for 15ms (max), and goes to
50 // SLEEP_MODE_PWR_DOWN
55 /** \brief suspend wakeup condition
59 __attribute__ ((weak)) void matrix_power_up(void) {}
60 __attribute__ ((weak)) void matrix_power_down(void) {}
61 bool suspend_wakeup_condition(void)
66 for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
67 if (matrix_get_row(r)) return true;
72 /** \brief run user level code immediately after wakeup
76 __attribute__ ((weak))
77 void suspend_wakeup_init_user(void) { }
79 /** \brief run keyboard level code immediately after wakeup
83 __attribute__ ((weak))
84 void suspend_wakeup_init_kb(void) {
85 suspend_power_down_user();
88 /** \brief suspend wakeup condition
90 * run immediately after wakeup
93 void suspend_wakeup_init(void)
95 // clear keyboard state
96 // need to do it manually, because we're running from ISR
97 // and clear_keyboard() calls print
98 // so only clear the variables in memory
99 // the reports will be sent from main.c afterwards
100 // or if the PC asks for GET_REPORT
104 #ifdef MOUSEKEY_ENABLE
106 #endif /* MOUSEKEY_ENABLE */
107 #ifdef EXTRAKEY_ENABLE
109 host_consumer_send(0);
110 #endif /* EXTRAKEY_ENABLE */
111 #ifdef BACKLIGHT_ENABLE
113 #endif /* BACKLIGHT_ENABLE */
114 suspend_wakeup_init_kb();