final clean up

This commit is contained in:
Wini-Buh
2021-06-22 23:49:24 +02:00
parent c5f6b57755
commit 51c6444e1d
5 changed files with 4 additions and 56 deletions

View File

@@ -1156,14 +1156,14 @@ void usbd_defer_func(osal_task_func_t func, void* param, bool in_isr)
bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep)
{
TU_LOG2(" Open EP %02X with Size = %u\r\n", desc_ep->bEndpointAddress, desc_ep->wMaxPacketSize.size);
TU_LOG2(" Open EP %02X with Size = %u\r\n", desc_ep->bEndpointAddress, tu_le16toh(desc_ep->wMaxPacketSize.size));
switch (desc_ep->bmAttributes.xfer)
{
case TUSB_XFER_ISOCHRONOUS:
{
uint16_t const max_epsize = (_usbd_dev.speed == TUSB_SPEED_HIGH ? 1024 : 1023);
TU_ASSERT(desc_ep->wMaxPacketSize.size <= max_epsize);
TU_ASSERT(tu_le16toh(desc_ep->wMaxPacketSize.size) <= max_epsize);
}
break;

View File

@@ -55,17 +55,9 @@ typedef struct
static usbd_control_xfer_t _ctrl_xfer;
#if defined(TU_HAS_NO_ATTR_ALIGNED)
// Helper union to overcome the lack of the alignment attribute/pragma
static union {
uint16_t : (sizeof(uint16_t) * 8); // Alignment of at least the size of the used type
uint8_t _usbd_ctrl_buf[CFG_TUD_ENDPOINT0_SIZE];
} Align_usbd_ctrl_buf_;
static uint8_t *_usbd_ctrl_buf = (uint8_t*)&Align_usbd_ctrl_buf_;
#else
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN
static uint8_t _usbd_ctrl_buf[CFG_TUD_ENDPOINT0_SIZE];
#endif
//--------------------------------------------------------------------+
// Application API