summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/keyboard.c12
-rw-r--r--tmk_core/common/keyboard.h5
2 files changed, 12 insertions, 5 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 24baf41c00..3d6092e71c 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -280,6 +280,15 @@ __attribute__((weak)) void housekeeping_task_kb(void) {}
*/
__attribute__((weak)) void housekeeping_task_user(void) {}
+/** \brief housekeeping_task
+ *
+ * Invokes hooks for executing code after QMK is done after each loop iteration.
+ */
+void housekeeping_task(void) {
+ housekeeping_task_kb();
+ housekeeping_task_user();
+}
+
/** \brief keyboard_init
*
* FIXME: needs doc
@@ -374,9 +383,6 @@ void keyboard_task(void) {
bool encoders_changed = false;
#endif
- housekeeping_task_kb();
- housekeeping_task_user();
-
uint8_t matrix_changed = matrix_scan();
if (matrix_changed) last_matrix_activity_trigger();
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h
index eaf74bac58..779973f1d6 100644
--- a/tmk_core/common/keyboard.h
+++ b/tmk_core/common/keyboard.h
@@ -70,8 +70,9 @@ void keyboard_pre_init_user(void);
void keyboard_post_init_kb(void);
void keyboard_post_init_user(void);
-void housekeeping_task_kb(void);
-void housekeeping_task_user(void);
+void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol
+void housekeeping_task_kb(void); // To be overridden by keyboard-level code
+void housekeeping_task_user(void); // To be overridden by user/keymap-level code
uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity
uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity