]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - vusb/host.c
FIX: send last report when idle timeouts. (pjrc)
[max/tmk_keyboard.git] / vusb / host.c
index 05a1f29cd19716ed368f074a5ebe7ad47a63b086..901537bcb89bd3c94d5f88b6e24c667723c4884c 100644 (file)
@@ -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)