From e6f79b1e5aa083c892e2c077c15a762639c7848d Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 28 Apr 2012 02:24:11 +0900 Subject: [PATCH] Workaround for Mac HID SET_IDLE behaviour. --- pjrc/usb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pjrc/usb.c b/pjrc/usb.c index 2b69b6a7..89087218 100644 --- a/pjrc/usb.c +++ b/pjrc/usb.c @@ -626,7 +626,7 @@ void usb_remote_wakeup(void) // ISR(USB_GEN_vect) { - uint8_t intbits, t, i; + uint8_t intbits, t; static uint8_t div4=0; intbits = UDINT; @@ -667,13 +667,16 @@ ISR(USB_GEN_vect) usb_keyboard_idle_count++; if (usb_keyboard_idle_count == usb_keyboard_idle_config) { usb_keyboard_idle_count = 0; + /* TODO: fix keyboard_report inconsistency */ +/* To avoid Mac SET_IDLE behaviour. UEDATX = keyboard_report_prev->mods; UEDATX = 0; uint8_t keys = usb_keyboard_protocol ? KBD_REPORT_KEYS : 6; - for (i=0; ikeys[i]; } UEINTX = 0x3A; +*/ } } }