aboutsummaryrefslogtreecommitdiff
path: root/quantum/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/keyboard.c')
-rw-r--r--quantum/keyboard.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/quantum/keyboard.c b/quantum/keyboard.c
index d7836cf36e..ad740de4b3 100644
--- a/quantum/keyboard.c
+++ b/quantum/keyboard.c
@@ -289,6 +289,21 @@ __attribute__((weak)) void keyboard_pre_init_kb(void) {
keyboard_pre_init_user();
}
+/** \brief keyboard_pre_init_modules
+ *
+ * FIXME: needs doc
+ */
+__attribute__((weak)) void keyboard_pre_init_modules(void) {}
+
+/** \brief keyboard_pre_init_quantum
+ *
+ * FIXME: needs doc
+ */
+void keyboard_pre_init_quantum(void) {
+ keyboard_pre_init_modules();
+ keyboard_pre_init_kb();
+}
+
/** \brief keyboard_post_init_user
*
* FIXME: needs doc
@@ -305,6 +320,23 @@ __attribute__((weak)) void keyboard_post_init_kb(void) {
keyboard_post_init_user();
}
+/** \brief keyboard_post_init_modules
+ *
+ * FIXME: needs doc
+ */
+
+__attribute__((weak)) void keyboard_post_init_modules(void) {}
+
+/** \brief keyboard_post_init_quantum
+ *
+ * FIXME: needs doc
+ */
+
+void keyboard_post_init_quantum(void) {
+ keyboard_post_init_modules();
+ keyboard_post_init_kb();
+}
+
/** \brief matrix_can_read
*
* Allows overriding when matrix scanning operations should be executed.
@@ -323,7 +355,7 @@ void keyboard_setup(void) {
eeprom_driver_init();
#endif
matrix_setup();
- keyboard_pre_init_kb();
+ keyboard_pre_init_quantum();
}
#ifndef SPLIT_KEYBOARD
@@ -355,6 +387,13 @@ __attribute__((weak)) bool should_process_keypress(void) {
return is_keyboard_master();
}
+/** \brief housekeeping_task_modules
+ *
+ * Codegen will override this if community modules are enabled.
+ * This is specific to keyboard-level functionality.
+ */
+__attribute__((weak)) void housekeeping_task_modules(void) {}
+
/** \brief housekeeping_task_kb
*
* Override this function if you have a need to execute code for every keyboard main loop iteration.
@@ -374,6 +413,7 @@ __attribute__((weak)) void housekeeping_task_user(void) {}
* Invokes hooks for executing code after QMK is done after each loop iteration.
*/
void housekeeping_task(void) {
+ housekeeping_task_modules();
housekeeping_task_kb();
housekeeping_task_user();
}
@@ -493,7 +533,7 @@ void keyboard_init(void) {
debug_enable = true;
#endif
- keyboard_post_init_kb(); /* Always keep this last */
+ keyboard_post_init_quantum(); /* Always keep this last */
}
/** \brief key_event_task