summaryrefslogtreecommitdiff
path: root/vusb
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2011-03-10 00:50:27 +0900
committertmk <nobody@nowhere>2011-03-10 11:17:54 +0900
commitcec254950509038ca9c805e87feea9091d77d29f (patch)
treec4f542b18dc080e32508aced1ee0ccce5cbf3a53 /vusb
parent1a7c3585ed9a68099e371b3180a404dd5d08ce1a (diff)
FIX: send last report when idle timeouts. (pjrc)
Diffstat (limited to 'vusb')
-rw-r--r--vusb/host.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vusb/host.c b/vusb/host.c
index 05a1f29cd1..901537bcb8 100644
--- a/vusb/host.c
+++ b/vusb/host.c
@@ -1,3 +1,5 @@
+#include <stdint.h>
+#include <avr/interrupt.h>
#include "usbdrv.h"
#include "usbconfig.h"
#include "print.h"
@@ -63,9 +65,12 @@ void host_add_code(uint8_t code)
void host_swap_keyboard_report(void)
{
+ uint8_t sreg = SREG;
+ cli();
report_keyboard_t *tmp = keyboard_report_prev;
keyboard_report_prev = keyboard_report;
keyboard_report = tmp;
+ SREG = sreg;
}
void host_clear_keyboard_report(void)