1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Revert "some optimizations, use real rx and tx buffer size instead of max buffer leghts"

It does not work in Windows so need further investigation prior to undo this revert
This reverts commit 901db6f828fefcfd0e0cda7bf684dacd779d05e6.
+review OPReview-501
This commit is contained in:
Alessio Morale 2013-06-05 19:01:01 +02:00
parent 8fb81ae17b
commit b4f8b02a42
2 changed files with 3 additions and 4 deletions

View File

@ -218,12 +218,12 @@ static bool PIOS_USB_HID_SendReport(struct pios_usb_hid_dev *usb_hid_dev)
#ifdef PIOS_USB_BOARD_BL_HID_HAS_NO_LENGTH_BYTE
PIOS_USBHOOK_EndpointTx(usb_hid_dev->cfg->data_tx_ep,
usb_hid_dev->tx_packet_buffer,
bytes_to_tx + 1);
sizeof(usb_hid_dev->tx_packet_buffer));
#else
usb_hid_dev->tx_packet_buffer[1] = bytes_to_tx;
PIOS_USBHOOK_EndpointTx(usb_hid_dev->cfg->data_tx_ep,
usb_hid_dev->tx_packet_buffer,
bytes_to_tx + 2);
sizeof(usb_hid_dev->tx_packet_buffer));
#endif
#if defined(PIOS_INCLUDE_FREERTOS)

View File

@ -402,8 +402,7 @@ static uint8_t PIOS_USBHOOK_CLASS_DataIn(void *pdev, uint8_t epnum)
if ((epnum_idx < NELEMENTS(usb_epin_table)) && usb_epin_table[epnum_idx].cb) {
struct usb_ep_entry *ep = &(usb_epin_table[epnum_idx]);
uint16_t rxcount = USBD_GetRxCount(pdev, epnum);
if (!ep->cb(ep->context, epnum_idx, rxcount)) {
if (!ep->cb(ep->context, epnum_idx, ep->max_len)) {
/* NOTE: use real endpoint number including direction bit */
DCD_SetEPStatus(pdev, epnum, USB_OTG_EP_TX_NAK);
}