diff options
| author | Nick Brassel <nick@tzarc.org> | 2021-05-18 17:02:28 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-18 17:02:28 +1000 |
| commit | 58142f0726147d538167ff3ab793743348f40dcd (patch) | |
| tree | e3db28a5c97c75c101af821283c56ce4dc017a3a | |
| parent | 6cdc996e0b40e9cd9a368e5ac2be2341aa9d6747 (diff) | |
| download | qmk_firmware-58142f0726147d538167ff3ab793743348f40dcd.tar.gz qmk_firmware-58142f0726147d538167ff3ab793743348f40dcd.zip | |
Fixup housekeeping from being invoked twice per loop. (#12933)
| -rw-r--r-- | tmk_core/common/keyboard.c | 12 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.h | 5 | ||||
| -rw-r--r-- | tmk_core/protocol/arm_atsam/main_arm_atsam.c | 3 | ||||
| -rw-r--r-- | tmk_core/protocol/chibios/main.c | 3 | ||||
| -rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 3 | ||||
| -rw-r--r-- | tmk_core/protocol/vusb/main.c | 3 |
6 files changed, 18 insertions, 11 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 24baf41c0..3d6092e71 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -280,6 +280,15 @@ __attribute__((weak)) void housekeeping_task_kb(void) {} | |||
| 280 | */ | 280 | */ |
| 281 | __attribute__((weak)) void housekeeping_task_user(void) {} | 281 | __attribute__((weak)) void housekeeping_task_user(void) {} |
| 282 | 282 | ||
| 283 | /** \brief housekeeping_task | ||
| 284 | * | ||
| 285 | * Invokes hooks for executing code after QMK is done after each loop iteration. | ||
| 286 | */ | ||
| 287 | void housekeeping_task(void) { | ||
| 288 | housekeeping_task_kb(); | ||
| 289 | housekeeping_task_user(); | ||
| 290 | } | ||
| 291 | |||
| 283 | /** \brief keyboard_init | 292 | /** \brief keyboard_init |
| 284 | * | 293 | * |
| 285 | * FIXME: needs doc | 294 | * FIXME: needs doc |
| @@ -374,9 +383,6 @@ void keyboard_task(void) { | |||
| 374 | bool encoders_changed = false; | 383 | bool encoders_changed = false; |
| 375 | #endif | 384 | #endif |
| 376 | 385 | ||
| 377 | housekeeping_task_kb(); | ||
| 378 | housekeeping_task_user(); | ||
| 379 | |||
| 380 | uint8_t matrix_changed = matrix_scan(); | 386 | uint8_t matrix_changed = matrix_scan(); |
| 381 | if (matrix_changed) last_matrix_activity_trigger(); | 387 | if (matrix_changed) last_matrix_activity_trigger(); |
| 382 | 388 | ||
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index eaf74bac5..779973f1d 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h | |||
| @@ -70,8 +70,9 @@ void keyboard_pre_init_user(void); | |||
| 70 | void keyboard_post_init_kb(void); | 70 | void keyboard_post_init_kb(void); |
| 71 | void keyboard_post_init_user(void); | 71 | void keyboard_post_init_user(void); |
| 72 | 72 | ||
| 73 | void housekeeping_task_kb(void); | 73 | void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol |
| 74 | void housekeeping_task_user(void); | 74 | void housekeeping_task_kb(void); // To be overridden by keyboard-level code |
| 75 | void housekeeping_task_user(void); // To be overridden by user/keymap-level code | ||
| 75 | 76 | ||
| 76 | uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity | 77 | uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity |
| 77 | uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity | 78 | uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity |
diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index e4e79d351..ce0f54593 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c | |||
| @@ -305,6 +305,9 @@ int main(void) { | |||
| 305 | // dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); | 305 | // dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); |
| 306 | } | 306 | } |
| 307 | #endif // CONSOLE_ENABLE | 307 | #endif // CONSOLE_ENABLE |
| 308 | |||
| 309 | // Run housekeeping | ||
| 310 | housekeeping_task(); | ||
| 308 | } | 311 | } |
| 309 | 312 | ||
| 310 | return 1; | 313 | return 1; |
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index e2ec01118..199741594 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c | |||
| @@ -257,7 +257,6 @@ int main(void) { | |||
| 257 | #endif | 257 | #endif |
| 258 | 258 | ||
| 259 | // Run housekeeping | 259 | // Run housekeeping |
| 260 | housekeeping_task_kb(); | 260 | housekeeping_task(); |
| 261 | housekeeping_task_user(); | ||
| 262 | } | 261 | } |
| 263 | } | 262 | } |
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 85d71d083..63619fdb3 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -1107,8 +1107,7 @@ int main(void) { | |||
| 1107 | #endif | 1107 | #endif |
| 1108 | 1108 | ||
| 1109 | // Run housekeeping | 1109 | // Run housekeeping |
| 1110 | housekeeping_task_kb(); | 1110 | housekeeping_task(); |
| 1111 | housekeeping_task_user(); | ||
| 1112 | } | 1111 | } |
| 1113 | } | 1112 | } |
| 1114 | 1113 | ||
diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 2de4f6a80..53926a749 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c | |||
| @@ -173,8 +173,7 @@ int main(void) { | |||
| 173 | #endif | 173 | #endif |
| 174 | 174 | ||
| 175 | // Run housekeeping | 175 | // Run housekeeping |
| 176 | housekeeping_task_kb(); | 176 | housekeeping_task(); |
| 177 | housekeeping_task_user(); | ||
| 178 | } | 177 | } |
| 179 | } | 178 | } |
| 180 | } | 179 | } |
