Chibios/usb_main: rename a variable for clarity.
This commit is contained in:
parent
8bcddd24f7
commit
7c4a2fab6d
@ -1121,24 +1121,26 @@ void send_keyboard(report_keyboard_t *report) {
|
|||||||
}
|
}
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
|
|
||||||
bool ret;
|
bool ep_not_ready;
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
if(keyboard_nkro) { /* NKRO protocol */
|
if(keyboard_nkro) { /* NKRO protocol */
|
||||||
usbPrepareTransmit(&USB_DRIVER, NKRO_ENDPOINT, (uint8_t *)report, sizeof(report_keyboard_t));
|
usbPrepareTransmit(&USB_DRIVER, NKRO_ENDPOINT, (uint8_t *)report, sizeof(report_keyboard_t));
|
||||||
|
/* need to wait until the previous packet has made it through */
|
||||||
do {
|
do {
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
ret = usbStartTransmitI(&USB_DRIVER, NKRO_ENDPOINT);
|
ep_not_ready = usbStartTransmitI(&USB_DRIVER, NKRO_ENDPOINT);
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
} while (ret);
|
} while (ep_not_ready);
|
||||||
} else
|
} else
|
||||||
#endif /* NKRO_ENABLE */
|
#endif /* NKRO_ENABLE */
|
||||||
{ /* boot protocol */
|
{ /* boot protocol */
|
||||||
usbPrepareTransmit(&USB_DRIVER, KBD_ENDPOINT, (uint8_t *)report, KBD_EPSIZE);
|
usbPrepareTransmit(&USB_DRIVER, KBD_ENDPOINT, (uint8_t *)report, KBD_EPSIZE);
|
||||||
|
/* need to wait until the previous packet has made it through */
|
||||||
do {
|
do {
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
ret = usbStartTransmitI(&USB_DRIVER, KBD_ENDPOINT);
|
ep_not_ready = usbStartTransmitI(&USB_DRIVER, KBD_ENDPOINT);
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
} while (ret);
|
} while (ep_not_ready);
|
||||||
}
|
}
|
||||||
keyboard_report_sent = *report;
|
keyboard_report_sent = *report;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user