Quellcode durchsuchen

Workaround for Mac HID SET_IDLE behaviour.

tags/v1.9
tmk vor 12 Jahren
Ursprung
Commit
9dec116bc0
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5
    2
      pjrc/usb.c

+ 5
- 2
pjrc/usb.c Datei anzeigen

// //
ISR(USB_GEN_vect) ISR(USB_GEN_vect)
{ {
uint8_t intbits, t, i;
uint8_t intbits, t;
static uint8_t div4=0; static uint8_t div4=0;


intbits = UDINT; intbits = UDINT;
usb_keyboard_idle_count++; usb_keyboard_idle_count++;
if (usb_keyboard_idle_count == usb_keyboard_idle_config) { if (usb_keyboard_idle_count == usb_keyboard_idle_config) {
usb_keyboard_idle_count = 0; usb_keyboard_idle_count = 0;
/* TODO: fix keyboard_report inconsistency */
/* To avoid Mac SET_IDLE behaviour.
UEDATX = keyboard_report_prev->mods; UEDATX = keyboard_report_prev->mods;
UEDATX = 0; UEDATX = 0;
uint8_t keys = usb_keyboard_protocol ? KBD_REPORT_KEYS : 6; uint8_t keys = usb_keyboard_protocol ? KBD_REPORT_KEYS : 6;
for (i=0; i<keys; i++) {
for (uint8_t i=0; i<keys; i++) {
UEDATX = keyboard_report_prev->keys[i]; UEDATX = keyboard_report_prev->keys[i];
} }
UEINTX = 0x3A; UEINTX = 0x3A;
*/
} }
} }
} }

Laden…
Abbrechen
Speichern