From 2ec268bd21c6bb8d6afbd4908fb0289b0d1c6bd2 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 24 Oct 2021 20:39:41 +0100 Subject: Begin to carve out platform/protocol API - Migrate keyboard_* calls (#14888) --- tmk_core/protocol/chibios/chibios.c | 15 +++------------ tmk_core/protocol/lufa/lufa.c | 19 ++++--------------- tmk_core/protocol/vusb/protocol.c | 7 ------- 3 files changed, 7 insertions(+), 34 deletions(-) (limited to 'tmk_core/protocol') diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index c860328c80..98b3305089 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -138,8 +138,6 @@ void protocol_setup(void) { // TESTING // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - - keyboard_setup(); } void protocol_init(void) { @@ -176,18 +174,10 @@ void protocol_init(void) { print("USB configured.\n"); - /* init TMK modules */ - keyboard_init(); host_set_driver(driver); - -#ifdef SLEEP_LED_ENABLE - sleep_led_init(); -#endif - - print("Keyboard start.\n"); } -void protocol_task(void) { +void protocol_pre_task(void) { usb_event_queue_task(); #if !defined(NO_USB_STARTUP_CHECK) @@ -210,8 +200,9 @@ void protocol_task(void) { # endif /* MOUSEKEY_ENABLE */ } #endif +} - keyboard_task(); +void protocol_post_task(void) { #ifdef CONSOLE_ENABLE console_task(); #endif diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 753762358d..80781d2f37 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1070,7 +1070,6 @@ void protocol_setup(void) { setup_mcu(); usb_device_state_init(); - keyboard_setup(); } void protocol_init(void) { @@ -1095,21 +1094,11 @@ void protocol_init(void) { #else USB_USBTask(); #endif - /* init modules */ - keyboard_init(); - host_set_driver(&lufa_driver); -#ifdef SLEEP_LED_ENABLE - sleep_led_init(); -#endif -#ifdef VIRTSER_ENABLE - virtser_init(); -#endif - - print("Keyboard start.\n"); + host_set_driver(&lufa_driver); } -void protocol_task(void) { +void protocol_pre_task(void) { #if !defined(NO_USB_STARTUP_CHECK) if (USB_DeviceState == DEVICE_STATE_Suspended) { print("[s]"); @@ -1133,9 +1122,9 @@ void protocol_task(void) { suspend_wakeup_init(); } #endif +} - keyboard_task(); - +void protocol_post_task(void) { #ifdef MIDI_ENABLE MIDI_Device_USBTask(&USB_MIDI_Interface); #endif diff --git a/tmk_core/protocol/vusb/protocol.c b/tmk_core/protocol/vusb/protocol.c index 89dc795b21..947c3383f1 100644 --- a/tmk_core/protocol/vusb/protocol.c +++ b/tmk_core/protocol/vusb/protocol.c @@ -111,22 +111,15 @@ void protocol_setup(void) { // clock prescaler clock_prescale_set(clock_div_1); #endif - keyboard_setup(); } void protocol_init(void) { setup_usb(); sei(); - keyboard_init(); - host_set_driver(vusb_driver()); wait_ms(50); - -#ifdef SLEEP_LED_ENABLE - sleep_led_init(); -#endif } void protocol_task(void) { -- cgit v1.2.3