From 110eea578b561f7169ea19927c54533c2b93b3a3 Mon Sep 17 00:00:00 2001
From: tmk <nobody@nowhere>
Date: Mon, 28 Apr 2014 15:21:42 +0900
Subject: [PATCH] Fix remotewakeup of PJRC stack(Fix #121)

- without this fix wakeup often fails
- keyboard can wakeup once or twice but fails after that
---
 protocol/pjrc/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/protocol/pjrc/usb.c b/protocol/pjrc/usb.c
index 2b267d4..1e6ba87 100644
--- a/protocol/pjrc/usb.c
+++ b/protocol/pjrc/usb.c
@@ -629,6 +629,7 @@ uint8_t usb_configured(void)
 void usb_remote_wakeup(void)
 {
     UDCON |= (1<<RMWKUP);
+    while (UDCON & (1<<RMWKUP));
 }
 
 
-- 
2.39.5