bug fix: allow user keymaps to use keyboard_post_init_user()

(applies previous commit to all Keychron keyboards)

Keyboard models which define keyboard_post_init_kb() are required
by QMK to call keyboard_post_init_user(), but Keychron's code did
not do this... so I fixed it.  This enables user keymaps to run
custom code on boot, like loading user eeprom data and activating
custom RGB settings.

For more info:
https://docs.qmk.fm/#/custom_quantum_functions?id=keyboard-post-initialization-code
https://docs.qmk.fm/#/custom_quantum_functions?id=example-implementation
This commit is contained in:
Selene ToyKeeper 2022-09-16 15:48:15 -06:00
parent 7083a70c21
commit afe9ccb101
33 changed files with 97 additions and 2 deletions

View File

@ -179,6 +179,9 @@ void keyboard_post_init_kb(void) {
PCMSK0 |= (1 << 7);
PCICR |= (1 << PCIE0);
sei();
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
ISR(PCINT0_vect) {

View File

@ -186,6 +186,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -178,6 +178,9 @@ void keyboard_post_init_kb(void) {
PCMSK0 |= (1 << 7);
PCICR |= (1 << PCIE0);
sei();
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
ISR(PCINT0_vect) {

View File

@ -187,6 +187,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -190,6 +190,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -187,6 +187,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // ENCODER_ENABLE

View File

@ -188,6 +188,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // ENCODER_ENABLE

View File

@ -159,6 +159,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -160,6 +160,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -183,6 +183,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -183,6 +183,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -187,6 +187,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -192,6 +192,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -191,6 +191,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -202,6 +202,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -201,6 +201,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -164,6 +164,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -161,6 +161,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -161,6 +161,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -137,6 +137,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif
#endif

View File

@ -138,6 +138,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif
#endif

View File

@ -177,8 +177,7 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init too
// (like loading user eeprom data)
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}

View File

@ -180,6 +180,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -181,6 +181,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -158,6 +158,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS
#endif // ENCODER_ENABLE

View File

@ -159,6 +159,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -183,6 +183,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -183,6 +183,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -192,6 +192,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -191,6 +191,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS

View File

@ -201,6 +201,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif

View File

@ -159,6 +159,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
#endif

View File

@ -160,6 +160,9 @@ void keyboard_post_init_kb(void) {
palEnableLineEvent(encoders_pad_b[0], PAL_EVENT_MODE_BOTH_EDGES);
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
// allow user keymaps to do custom post_init
keyboard_post_init_user();
}
# endif // PAL_USE_CALLBACKS
#endif // ENCODER_ENABLE