update tud_hid_keyboard/mouse helper

This commit is contained in:
hathach
2019-04-18 13:24:07 +07:00
parent 8d2db4dd70
commit a30461b078
6 changed files with 64 additions and 111 deletions

View File

@@ -153,11 +153,10 @@ void usb_hid_task(void)
uint8_t keycode[6] = { 0 };
keycode[0] = HID_KEY_A;
tud_hid_keyboard_keycode(0, keycode);
tud_hid_keyboard_report(0, 0, keycode);
}else
{
// Null means all zeroes keycodes
tud_hid_keyboard_keycode(0, NULL);
tud_hid_keyboard_key_release(0);
}
}
#endif

View File

@@ -172,11 +172,11 @@ void usb_hid_task(void* params)
if ( btn & (1 << i) ) keycode[i] = HID_KEY_A + i;
}
tud_hid_keyboard_keycode(0, keycode);
tud_hid_keyboard_report(0, keycode);
}else
{
// Null means all zeroes keycodes
tud_hid_keyboard_keycode(0, NULL);
tud_hid_keyboard_report(0, NULL);
}
}