summaryrefslogtreecommitdiff
path: root/tinyusb/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-10 14:20:38 +0700
committerhathach <[email protected]>2014-03-10 14:20:38 +0700
commitb586fe632acb45dc0577a9ab447fe02ab6cb457d (patch)
tree6befaafae699e40ac96e32233336ef0e251a2cea /tinyusb/device
parentad72db5aeacf7d969f5c091c59a2f279eaf1c19c (diff)
change desc_str_table to array of pointer of uint8_t* to be compatible with IAR (lack of support for VLA initialization)
IAR device os none works with ea4357
Diffstat (limited to 'tinyusb/device')
-rw-r--r--tinyusb/device/dcd_lpc43xx.c8
-rw-r--r--tinyusb/device/usbd.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/tinyusb/device/dcd_lpc43xx.c b/tinyusb/device/dcd_lpc43xx.c
index 05e47fd11..036c65a64 100644
--- a/tinyusb/device/dcd_lpc43xx.c
+++ b/tinyusb/device/dcd_lpc43xx.c
@@ -351,7 +351,7 @@ void dcd_pipe_control_stall(uint8_t coreid)
}
// control transfer does not need to use qtd find function
-tusb_error_t dcd_pipe_control_xfer(uint8_t coreid, tusb_direction_t dir, void * p_buffer, uint16_t length, bool int_on_complete)
+tusb_error_t dcd_pipe_control_xfer(uint8_t coreid, tusb_direction_t dir, uint8_t * p_buffer, uint16_t length, bool int_on_complete)
{
LPC_USB0_Type* const lpc_usb = LPC_USB[coreid];
dcd_data_t* const p_dcd = dcd_data_ptr[coreid];
@@ -485,12 +485,12 @@ static tusb_error_t pipe_add_xfer(endpoint_handle_t edpt_hdl, void * buffer, uin
return TUSB_ERROR_NONE;
}
-tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, void * buffer, uint16_t total_bytes)
+tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes)
{
return pipe_add_xfer( edpt_hdl, buffer, total_bytes, false);
}
-tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, void* buffer, uint16_t total_bytes, bool int_on_complete)
+tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes, bool int_on_complete)
{
ASSERT_STATUS ( pipe_add_xfer(edpt_hdl, buffer, total_bytes, int_on_complete) );
@@ -602,7 +602,7 @@ void dcd_isr(uint8_t coreid)
.class_code = 0
};
- dcd_qtd_t * const p_qtd = &p_dcd->qhd[ (edpt_complete & BIT_(0)) ? 0 : 1 ].qtd_overlay;
+ dcd_qtd_t volatile * const p_qtd = &p_dcd->qhd[ (edpt_complete & BIT_(0)) ? 0 : 1 ].qtd_overlay;
tusb_event_t event = ( p_qtd->xact_err || p_qtd->halted || p_qtd->buffer_err ) ? TUSB_EVENT_XFER_ERROR : TUSB_EVENT_XFER_COMPLETE;
usbd_xfer_isr(edpt_hdl, event, 0); // TODO xferred bytes for control xfer is not needed yet !!!!
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c
index 38d139f1f..0b9044db9 100644
--- a/tinyusb/device/usbd.c
+++ b/tinyusb/device/usbd.c
@@ -344,7 +344,7 @@ static tusb_error_t get_descriptor(uint8_t coreid, tusb_control_request_t const
if ( ! (desc_index < TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT) ) return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;
(*pp_buffer) = (uint8_t *) desc_str_table[desc_index];
- (*p_length) = desc_str_table[desc_index]->bLength;
+ (*p_length) = **pp_buffer;
}else
{
return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;