From c217186bea9226f87ef4b8acc926c3f21a0fea85 Mon Sep 17 00:00:00 2001
From: yiancar <yiangosyiangou@cytanet.com.cy>
Date: Wed, 1 Apr 2020 17:11:24 +0100
Subject: [PATCH] Updated V-USB template to allow usbFunctionWriteOut (#8634)

---
 tmk_core/protocol/vusb/usbconfig.h | 2 +-
 tmk_core/protocol/vusb/vusb.c      | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/tmk_core/protocol/vusb/usbconfig.h b/tmk_core/protocol/vusb/usbconfig.h
index f3cfd84aba..f156163510 100644
--- a/tmk_core/protocol/vusb/usbconfig.h
+++ b/tmk_core/protocol/vusb/usbconfig.h
@@ -123,7 +123,7 @@ section at the end of this file).
  * data from a static buffer, set it to 0 and return the data from
  * usbFunctionSetup(). This saves a couple of bytes.
  */
-#define USB_CFG_IMPLEMENT_FN_WRITEOUT   0
+#define USB_CFG_IMPLEMENT_FN_WRITEOUT   1
 /* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
  * You must implement the function usbFunctionWriteOut() which receives all
  * interrupt/bulk data sent to any endpoint other than 0. The endpoint number
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index 47dc1245d0..95c59d4931 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -106,8 +106,6 @@ void raw_hid_send(uint8_t *data, uint8_t length) {
         usbPoll();
     }
     usbSetInterrupt3(0, 0);
-    usbPoll();
-    _delay_ms(1);
 }
 
 __attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) {