Add support for joystick adc reading for stm32 MCUs. Fix joystick hid report sending for chibios

This commit is contained in:
a-chol 2020-03-29 15:43:19 +02:00
parent 34bedc3787
commit def06b4976
4 changed files with 15 additions and 11 deletions

View file

@ -935,7 +935,15 @@ void send_joystick_packet(joystick_t *joystick) {
# endif // JOYSTICK_BUTTON_COUNT>0
};
chnWrite(&drivers.joystick_driver.driver, (uint8_t *)&rep, sizeof(rep));
// chnWrite(&drivers.joystick_driver.driver, (uint8_t *)&rep, sizeof(rep));
osalSysLock();
if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) {
osalSysUnlock();
return;
}
usbStartTransmitI(&USB_DRIVER, JOYSTICK_IN_EPNUM, (uint8_t *)&rep, sizeof(joystick_report_t));
osalSysUnlock();
}
#endif