diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 10:59:35 -0400 | 
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 10:59:35 -0400 | 
| commit | 998ddbb122c9d3e2a77bd4e88c881b225ca0d569 (patch) | |
| tree | ca91ff7ad3c4866555d1e623fe9ea05276397e1c /tmk_core/common/chibios/suspend.c | |
| parent | c0095710a7c7e9bd94aa9f4dd814dc28d718c731 (diff) | |
| parent | 06487daaddf923d635e8a528d1eb644b875a73f6 (diff) | |
Merge branch 'master' of github.com:qmk/qmk_firmware into hf/shinydox
Diffstat (limited to 'tmk_core/common/chibios/suspend.c')
| -rw-r--r-- | tmk_core/common/chibios/suspend.c | 33 | 
1 files changed, 33 insertions, 0 deletions
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 32ef773e2e..4a119ccefe 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -21,6 +21,21 @@ void suspend_idle(uint8_t time) {  	wait_ms(time);  } +/** \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 suspend power down   *   * FIXME: needs doc @@ -30,6 +45,7 @@ void suspend_power_down(void) {  	// shouldn't power down TPM/FTM if we want a breathing LED  	// also shouldn't power down USB +  suspend_power_down_kb();  	// on AVR, this enables the watchdog for 15ms (max), and goes to  	// SLEEP_MODE_PWR_DOWN @@ -53,6 +69,22 @@ bool suspend_wakeup_condition(void)      return false;  } +/** \brief run user level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_user(void) { } + +/** \brief run keyboard level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_kb(void) { +  suspend_power_down_user(); +} +  /** \brief suspend wakeup condition   *   * run immediately after wakeup @@ -79,4 +111,5 @@ void suspend_wakeup_init(void)  #ifdef BACKLIGHT_ENABLE      backlight_init();  #endif /* BACKLIGHT_ENABLE */ +  suspend_wakeup_init_kb();  }  | 
