summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/lufa.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r--tmk_core/protocol/lufa/lufa.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 998db1c6d8..c68c3c2e5b 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -90,6 +90,10 @@ extern keymap_config_t keymap_config;
# include "raw_hid.h"
#endif
+#ifdef WEBUSB_ENABLE
+#include "webusb.h"
+#endif
+
uint8_t keyboard_idle = 0;
/* 0: Boot Protocol, 1: Report Protocol(default) */
uint8_t keyboard_protocol = 1;
@@ -307,7 +311,12 @@ static void webusb_task(void) {
Endpoint_ClearOUT();
if (data_read) {
- webusb_receive(data, sizeof(data));
+ if(webusb_state.paired == true) {
+ webusb_receive(data, sizeof(data));
+ }
+ else {
+ webusb_error(WEBUSB_STATUS_NOT_PAIRED);
+ }
}
}
}