Ensure more _user functions will always run
This commit is contained in:
parent
256fabca9e
commit
0d8b4d6fa6
5 changed files with 20 additions and 11 deletions
|
@ -20,7 +20,7 @@ __attribute__((weak)) void suspend_power_down_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user(); }
|
__attribute__((weak)) void suspend_power_down_kb(void) {}
|
||||||
|
|
||||||
/** \brief Suspend power down
|
/** \brief Suspend power down
|
||||||
*
|
*
|
||||||
|
@ -32,6 +32,7 @@ void suspend_power_down(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
suspend_power_down_kb();
|
suspend_power_down_kb();
|
||||||
|
suspend_power_down_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void matrix_power_up(void) {}
|
__attribute__((weak)) void matrix_power_up(void) {}
|
||||||
|
@ -56,7 +57,7 @@ __attribute__((weak)) void suspend_wakeup_init_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); }
|
__attribute__((weak)) void suspend_wakeup_init_kb(void) {}
|
||||||
|
|
||||||
/** \brief run immediately after wakeup
|
/** \brief run immediately after wakeup
|
||||||
*
|
*
|
||||||
|
@ -74,4 +75,5 @@ void suspend_wakeup_init(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
suspend_wakeup_init_kb();
|
suspend_wakeup_init_kb();
|
||||||
|
suspend_wakeup_init_user();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ __attribute__((weak)) void suspend_power_down_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user(); }
|
__attribute__((weak)) void suspend_power_down_kb(void) {}
|
||||||
|
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
/** \brief Power down MCU with watchdog timer
|
/** \brief Power down MCU with watchdog timer
|
||||||
|
@ -132,6 +132,7 @@ static void power_down(uint8_t wdto) {
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
suspend_power_down_kb();
|
suspend_power_down_kb();
|
||||||
|
suspend_power_down_user();
|
||||||
|
|
||||||
// TODO: more power saving
|
// TODO: more power saving
|
||||||
// See PicoPower application note
|
// See PicoPower application note
|
||||||
|
@ -156,6 +157,7 @@ static void power_down(uint8_t wdto) {
|
||||||
*/
|
*/
|
||||||
void suspend_power_down(void) {
|
void suspend_power_down(void) {
|
||||||
suspend_power_down_kb();
|
suspend_power_down_kb();
|
||||||
|
suspend_power_down_user();
|
||||||
|
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
power_down(WDTO_15MS);
|
power_down(WDTO_15MS);
|
||||||
|
@ -184,7 +186,7 @@ __attribute__((weak)) void suspend_wakeup_init_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); }
|
__attribute__((weak)) void suspend_wakeup_init_kb(void) {}
|
||||||
/** \brief run immediately after wakeup
|
/** \brief run immediately after wakeup
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
|
@ -209,6 +211,7 @@ void suspend_wakeup_init(void) {
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
suspend_wakeup_init_kb();
|
suspend_wakeup_init_kb();
|
||||||
|
suspend_wakeup_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
|
|
|
@ -40,7 +40,7 @@ __attribute__((weak)) void suspend_power_down_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user(); }
|
__attribute__((weak)) void suspend_power_down_kb(void) {}
|
||||||
|
|
||||||
/** \brief suspend power down
|
/** \brief suspend power down
|
||||||
*
|
*
|
||||||
|
@ -62,6 +62,7 @@ void suspend_power_down(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
suspend_power_down_kb();
|
suspend_power_down_kb();
|
||||||
|
suspend_power_down_user();
|
||||||
// on AVR, this enables the watchdog for 15ms (max), and goes to
|
// on AVR, this enables the watchdog for 15ms (max), and goes to
|
||||||
// SLEEP_MODE_PWR_DOWN
|
// SLEEP_MODE_PWR_DOWN
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ __attribute__((weak)) void suspend_wakeup_init_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); }
|
__attribute__((weak)) void suspend_wakeup_init_kb(void) {}
|
||||||
|
|
||||||
/** \brief suspend wakeup condition
|
/** \brief suspend wakeup condition
|
||||||
*
|
*
|
||||||
|
@ -131,4 +132,5 @@ void suspend_wakeup_init(void) {
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
suspend_wakeup_init_kb();
|
suspend_wakeup_init_kb();
|
||||||
|
suspend_wakeup_init_user();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,6 @@ __attribute__((weak)) void eeconfig_init_user(void) {
|
||||||
__attribute__((weak)) void eeconfig_init_kb(void) {
|
__attribute__((weak)) void eeconfig_init_kb(void) {
|
||||||
// Reset Keyboard EEPROM value to blank, rather than to a set value
|
// Reset Keyboard EEPROM value to blank, rather than to a set value
|
||||||
eeconfig_update_kb(0);
|
eeconfig_update_kb(0);
|
||||||
|
|
||||||
eeconfig_init_user();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -66,6 +64,7 @@ void eeconfig_init_quantum(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eeconfig_init_kb();
|
eeconfig_init_kb();
|
||||||
|
eeconfig_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief eeconfig initialization
|
/** \brief eeconfig initialization
|
||||||
|
|
|
@ -179,7 +179,7 @@ __attribute__((weak)) void keyboard_pre_init_user(void) {}
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
__attribute__((weak)) void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); }
|
__attribute__((weak)) void keyboard_pre_init_kb(void) {}
|
||||||
|
|
||||||
/** \brief keyboard_post_init_user
|
/** \brief keyboard_post_init_user
|
||||||
*
|
*
|
||||||
|
@ -193,7 +193,7 @@ __attribute__((weak)) void keyboard_post_init_user() {}
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__attribute__((weak)) void keyboard_post_init_kb(void) { keyboard_post_init_user(); }
|
__attribute__((weak)) void keyboard_post_init_kb(void) { }
|
||||||
|
|
||||||
/** \brief keyboard_setup
|
/** \brief keyboard_setup
|
||||||
*
|
*
|
||||||
|
@ -205,6 +205,7 @@ void keyboard_setup(void) {
|
||||||
#endif
|
#endif
|
||||||
matrix_setup();
|
matrix_setup();
|
||||||
keyboard_pre_init_kb();
|
keyboard_pre_init_kb();
|
||||||
|
keyboard_pre_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief is_keyboard_master
|
/** \brief is_keyboard_master
|
||||||
|
@ -262,7 +263,9 @@ void keyboard_init(void) {
|
||||||
keymap_config.nkro = 1;
|
keymap_config.nkro = 1;
|
||||||
eeconfig_update_keymap(keymap_config.raw);
|
eeconfig_update_keymap(keymap_config.raw);
|
||||||
#endif
|
#endif
|
||||||
keyboard_post_init_kb(); /* Always keep this last */
|
/* Always keep these last. */
|
||||||
|
keyboard_post_init_kb();
|
||||||
|
keyboard_post_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Keyboard task: Do keyboard routine jobs
|
/** \brief Keyboard task: Do keyboard routine jobs
|
||||||
|
|
Loading…
Reference in a new issue