mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-07 05:54:11 +08:00
fix incorrect setup packet
also increase usbd stack in example when debug is enabled
This commit is contained in:
parent
2ff3f765db
commit
ae1314f1c7
@ -56,7 +56,13 @@ StaticTimer_t blinky_tmdef;
|
|||||||
TimerHandle_t blinky_tm;
|
TimerHandle_t blinky_tm;
|
||||||
|
|
||||||
// static task for usbd
|
// static task for usbd
|
||||||
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
|
// Increase stack size when debug log is enabled
|
||||||
|
#if CFG_TUSB_DEBUG
|
||||||
|
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE)
|
||||||
|
#else
|
||||||
|
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
|
||||||
|
#endif
|
||||||
|
|
||||||
StackType_t usb_device_stack[USBD_STACK_SIZE];
|
StackType_t usb_device_stack[USBD_STACK_SIZE];
|
||||||
StaticTask_t usb_device_taskdef;
|
StaticTask_t usb_device_taskdef;
|
||||||
|
|
||||||
|
@ -331,9 +331,8 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to
|
|||||||
USB0.dtknqr4_fifoemptymsk |= (1 << epnum);
|
USB0.dtknqr4_fifoemptymsk |= (1 << epnum);
|
||||||
} else {
|
} else {
|
||||||
// Each complete packet for OUT xfers triggers XFRC.
|
// Each complete packet for OUT xfers triggers XFRC.
|
||||||
USB0.out_ep_reg[epnum].doeptsiz = USB_PKTCNT0_M |
|
USB0.out_ep_reg[epnum].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
|
||||||
((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
|
USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
|
||||||
USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -603,8 +602,7 @@ static void handle_epout_ints(void)
|
|||||||
dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
|
dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
|
||||||
} else {
|
} else {
|
||||||
// Schedule another packet to be received.
|
// Schedule another packet to be received.
|
||||||
USB0.out_ep_reg[n].doeptsiz = USB_PKTCNT0_M |
|
USB0.out_ep_reg[n].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
|
||||||
((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
|
|
||||||
USB0.out_ep_reg[n].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
|
USB0.out_ep_reg[n].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user