mirror of
https://github.com/hathach/tinyusb.git
synced 2025-10-29 19:49:07 +00:00
Fix some IAR warnings
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
parent
d3ab48bd79
commit
5755afa690
@ -519,7 +519,8 @@ bool hidh_open(uint8_t rhport, uint8_t daddr, tusb_desc_interface_t const* desc_
|
||||
|
||||
// Assume bNumDescriptors = 1
|
||||
p_hid->report_desc_type = desc_hid->bReportType;
|
||||
p_hid->report_desc_len = tu_unaligned_read16(&desc_hid->wReportLength);
|
||||
// Use offsetof to avoid pointer to the odd/misaligned address
|
||||
p_hid->report_desc_len = tu_unaligned_read16((uint8_t const*)desc_hid + offsetof(tusb_hid_descriptor_hid_t, wReportLength));
|
||||
|
||||
// Per HID Specs: default is Report protocol, though we will force Boot protocol when set_config
|
||||
p_hid->protocol_mode = _hidh_default_protocol;
|
||||
|
||||
@ -400,7 +400,7 @@ bool tuh_descriptor_get_device_local(uint8_t daddr, tusb_desc_device_t* desc_dev
|
||||
tusb_speed_t tuh_speed_get(uint8_t daddr) {
|
||||
tuh_bus_info_t bus_info;
|
||||
tuh_bus_info_get(daddr, &bus_info);
|
||||
return bus_info.speed;
|
||||
return (tusb_speed_t)bus_info.speed;
|
||||
}
|
||||
|
||||
bool tuh_rhport_is_active(uint8_t rhport) {
|
||||
@ -651,7 +651,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr) {
|
||||
tuh_xfer_t xfer = {
|
||||
.daddr = event.dev_addr,
|
||||
.ep_addr = ep_addr,
|
||||
.result = event.xfer_complete.result,
|
||||
.result = (xfer_result_t)event.xfer_complete.result,
|
||||
.actual_len = event.xfer_complete.len,
|
||||
.buflen = 0, // not available
|
||||
.buffer = NULL, // not available
|
||||
@ -832,18 +832,19 @@ static bool usbh_control_xfer_cb (uint8_t daddr, uint8_t ep_addr, xfer_result_t
|
||||
}
|
||||
TU_ATTR_FALLTHROUGH;
|
||||
|
||||
case CONTROL_STAGE_DATA:
|
||||
if (request->wLength) {
|
||||
TU_LOG_USBH("[%u:%u] Control data:\r\n", rhport, daddr);
|
||||
TU_LOG_MEM_USBH(ctrl_info->buffer, xferred_bytes, 2);
|
||||
}
|
||||
ctrl_info->actual_len = (uint16_t) xferred_bytes;
|
||||
case CONTROL_STAGE_DATA: {
|
||||
if (request->wLength) {
|
||||
TU_LOG_USBH("[%u:%u] Control data:\r\n", rhport, daddr);
|
||||
TU_LOG_MEM_USBH(ctrl_info->buffer, xferred_bytes, 2);
|
||||
}
|
||||
ctrl_info->actual_len = (uint16_t) xferred_bytes;
|
||||
|
||||
// ACK stage: toggle is always 1
|
||||
_control_set_xfer_stage(CONTROL_STAGE_ACK);
|
||||
const uint8_t ep_status = tu_edpt_addr(0, 1 - request->bmRequestType_bit.direction);
|
||||
TU_ASSERT(hcd_edpt_xfer(rhport, daddr, ep_status, NULL, 0));
|
||||
break;
|
||||
// ACK stage: toggle is always 1
|
||||
_control_set_xfer_stage(CONTROL_STAGE_ACK);
|
||||
const uint8_t ep_status = tu_edpt_addr(0, 1 - request->bmRequestType_bit.direction);
|
||||
TU_ASSERT(hcd_edpt_xfer(rhport, daddr, ep_status, NULL, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
case CONTROL_STAGE_ACK: {
|
||||
// Abort all pending transfers if SET_CONFIGURATION request
|
||||
|
||||
@ -184,7 +184,8 @@ static void ehci_enable_schedule(ehci_registers_t* regs, bool is_period) {
|
||||
//--------------------------------------------------------------------+
|
||||
uint32_t hcd_frame_number(uint8_t rhport) {
|
||||
(void) rhport;
|
||||
return (ehci_data.uframe_number + ehci_data.regs->frame_index) >> 3;
|
||||
uint32_t uframe = ehci_data.regs->frame_index;
|
||||
return (ehci_data.uframe_number + uframe) >> 3;
|
||||
}
|
||||
|
||||
void hcd_port_reset(uint8_t rhport) {
|
||||
@ -896,7 +897,7 @@ static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t c
|
||||
p_qhd->used = 1;
|
||||
p_qhd->removing = 0;
|
||||
p_qhd->attached_qtd = NULL;
|
||||
p_qhd->pid = tu_edpt_dir(ep_desc->bEndpointAddress) ? EHCI_PID_IN : EHCI_PID_OUT; // PID for TD under this endpoint
|
||||
p_qhd->pid = tu_edpt_dir(ep_desc->bEndpointAddress) == TUSB_DIR_IN ? EHCI_PID_IN : EHCI_PID_OUT; // PID for TD under this endpoint
|
||||
|
||||
//------------- active, but no TD list -------------//
|
||||
p_qhd->qtd_overlay.halted = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user