summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios/chibios.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/chibios/chibios.c')
-rw-r--r--tmk_core/protocol/chibios/chibios.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c
index 78a2e3fcbb..c860328c80 100644
--- a/tmk_core/protocol/chibios/chibios.c
+++ b/tmk_core/protocol/chibios/chibios.c
@@ -27,6 +27,7 @@
#include "keyboard.h"
#include "action.h"
#include "action_util.h"
+#include "usb_device_state.h"
#include "mousekey.h"
#include "led.h"
#include "sendchar.h"
@@ -42,12 +43,6 @@
#ifdef SLEEP_LED_ENABLE
# include "sleep_led.h"
#endif
-#ifdef SERIAL_LINK_ENABLE
-# include "serial_link/system/serial_link.h"
-#endif
-#ifdef VISUALIZER_ENABLE
-# include "visualizer/visualizer.h"
-#endif
#ifdef MIDI_ENABLE
# include "qmk_midi.h"
#endif
@@ -139,6 +134,8 @@ void boardInit(void) {
}
void protocol_setup(void) {
+ usb_device_state_init();
+
// TESTING
// chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
@@ -154,19 +151,11 @@ void protocol_init(void) {
setup_midi();
#endif
-#ifdef SERIAL_LINK_ENABLE
- init_serial_link();
-#endif
-
-#ifdef VISUALIZER_ENABLE
- visualizer_init();
-#endif
-
host_driver_t *driver = NULL;
- /* Wait until the USB or serial link is active */
+ /* Wait until USB is active */
while (true) {
-#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE)
+#if defined(WAIT_FOR_USB)
if (USB_DRIVER.state == USB_ACTIVE) {
driver = &chibios_driver;
break;
@@ -175,13 +164,6 @@ void protocol_init(void) {
driver = &chibios_driver;
break;
#endif
-#ifdef SERIAL_LINK_ENABLE
- if (is_serial_link_connected()) {
- driver = get_serial_link_driver();
- break;
- }
- serial_link_update();
-#endif
wait_ms(50);
}
@@ -211,14 +193,8 @@ void protocol_task(void) {
#if !defined(NO_USB_STARTUP_CHECK)
if (USB_DRIVER.state == USB_SUSPENDED) {
print("[s]");
-# ifdef VISUALIZER_ENABLE
- visualizer_suspend();
-# endif
while (USB_DRIVER.state == USB_SUSPENDED) {
/* Do this in the suspended state */
-# ifdef SERIAL_LINK_ENABLE
- serial_link_update();
-# endif
suspend_power_down(); // on AVR this deep sleeps for 15ms
/* Remote wakeup */
if (suspend_wakeup_condition()) {
@@ -232,10 +208,6 @@ void protocol_task(void) {
# ifdef MOUSEKEY_ENABLE
mousekey_send();
# endif /* MOUSEKEY_ENABLE */
-
-# ifdef VISUALIZER_ENABLE
- visualizer_resume();
-# endif
}
#endif