mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2025-01-06 09:01:21 +06:00
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:
parent
7083a70c21
commit
afe9ccb101
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user