diff options
author | Joel Challis <git@zvecr.com> | 2021-10-24 20:39:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-24 20:39:41 +0100 |
commit | 2ec268bd21c6bb8d6afbd4908fb0289b0d1c6bd2 (patch) | |
tree | 48614655e9276d59038359339ebb33e8623b3a38 /quantum | |
parent | c3c562cbb698347f76977a9176d281594e8c77a3 (diff) | |
download | qmk_firmware-2ec268bd21c6bb8d6afbd4908fb0289b0d1c6bd2.tar.gz qmk_firmware-2ec268bd21c6bb8d6afbd4908fb0289b0d1c6bd2.zip |
Begin to carve out platform/protocol API - Migrate keyboard_* calls (#14888)
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/keyboard.c | 6 | ||||
-rw-r--r-- | quantum/main.c | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/quantum/keyboard.c b/quantum/keyboard.c index f2a0889c1..f8e36994d 100644 --- a/quantum/keyboard.c +++ b/quantum/keyboard.c | |||
@@ -335,6 +335,12 @@ void keyboard_init(void) { | |||
335 | #ifdef DIP_SWITCH_ENABLE | 335 | #ifdef DIP_SWITCH_ENABLE |
336 | dip_switch_init(); | 336 | dip_switch_init(); |
337 | #endif | 337 | #endif |
338 | #ifdef SLEEP_LED_ENABLE | ||
339 | sleep_led_init(); | ||
340 | #endif | ||
341 | #ifdef VIRTSER_ENABLE | ||
342 | virtser_init(); | ||
343 | #endif | ||
338 | 344 | ||
339 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) | 345 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) |
340 | debug_enable = true; | 346 | debug_enable = true; |
diff --git a/quantum/main.c b/quantum/main.c index 2cbcd73d8..a896a67c6 100644 --- a/quantum/main.c +++ b/quantum/main.c | |||
@@ -20,7 +20,18 @@ void platform_setup(void); | |||
20 | 20 | ||
21 | void protocol_setup(void); | 21 | void protocol_setup(void); |
22 | void protocol_init(void); | 22 | void protocol_init(void); |
23 | void protocol_task(void); | 23 | void protocol_pre_task(void); |
24 | void protocol_post_task(void); | ||
25 | |||
26 | // Bodge as refactoring vusb sucks.... | ||
27 | void protocol_task(void) __attribute__((weak)); | ||
28 | void protocol_task(void) { | ||
29 | protocol_pre_task(); | ||
30 | |||
31 | keyboard_task(); | ||
32 | |||
33 | protocol_post_task(); | ||
34 | } | ||
24 | 35 | ||
25 | /** \brief Main | 36 | /** \brief Main |
26 | * | 37 | * |
@@ -30,8 +41,10 @@ int main(void) __attribute__((weak)); | |||
30 | int main(void) { | 41 | int main(void) { |
31 | platform_setup(); | 42 | platform_setup(); |
32 | protocol_setup(); | 43 | protocol_setup(); |
44 | keyboard_setup(); | ||
33 | 45 | ||
34 | protocol_init(); | 46 | protocol_init(); |
47 | keyboard_init(); | ||
35 | 48 | ||
36 | /* Main loop */ | 49 | /* Main loop */ |
37 | while (true) { | 50 | while (true) { |