From f3edef8c69384d92c026c4ffbcc167464d045c03 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Tue, 5 Nov 2019 19:02:07 +0900 Subject: feat: adds pairing key --- tmk_core/protocol/chibios/usb_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tmk_core/protocol/chibios') diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index e2440601e3..8a249e19e3 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -37,6 +37,9 @@ extern keymap_config_t keymap_config; #endif +#ifdef WEBUSB_ENABLE +#include "webusb.h" +#endif /* --------------------------------------------------------- * Global interface variables and declarations * --------------------------------------------------------- @@ -880,7 +883,12 @@ void webusb_task(void) { do { size_t size = chnReadTimeout(&drivers.webusb_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); if (size > 0) { - webusb_receive(buffer, size); + if(webusb_state.paired == true) { + webusb_receive(buffer, size); + } + else { + webusb_error(WEBUSB_STATUS_NOT_PAIRED); + } } } while (size > 0); } -- cgit v1.2.3