fix build error with device 43xx

refractor mscd ramdisk demo
This commit is contained in:
hathach
2013-11-15 00:01:07 +07:00
parent 6e8440afe5
commit ba49d26e19
10 changed files with 384 additions and 167 deletions

View File

@@ -176,8 +176,7 @@ void mscd_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_b
}
//------------- Status Phase -------------//
// TODO need to be true for dcd_lpc43xx to clean up qtd !!!
ASSERT( dcd_pipe_xfer( p_msc->edpt_in , &p_msc->csw, sizeof(msc_cmd_status_wrapper_t), true) == TUSB_ERROR_NONE, VOID_RETURN );
ASSERT( dcd_pipe_xfer( p_msc->edpt_in , &p_msc->csw, sizeof(msc_cmd_status_wrapper_t), true) == TUSB_ERROR_NONE, VOID_RETURN ); // need to be true for dcd to clean up qtd !!
//------------- Queue the next CBW -------------//
ASSERT( dcd_pipe_xfer( p_msc->edpt_out, &p_msc->cbw, sizeof(msc_cmd_block_wrapper_t), true) == TUSB_ERROR_NONE, VOID_RETURN );

View File

@@ -143,10 +143,9 @@ typedef struct {
/// thus there are 16 bytes padding free that we can make use of.
//--------------------------------------------------------------------+
uint8_t class_code; // Class code that endpoint belongs to
uint8_t xfer_type;
uint8_t list_qtd_idx[DCD_QTD_PER_QHD_MAX];
uint8_t reserved[14-DCD_QTD_PER_QHD_MAX];
uint8_t reserved[15-DCD_QTD_PER_QHD_MAX];
} ATTR_ALIGNED(64) dcd_qhd_t;
STATIC_ASSERT( sizeof(dcd_qhd_t) == 64, "size is not correct");
@@ -404,7 +403,7 @@ tusb_error_t dcd_pipe_clear_stall(uint8_t coreid, uint8_t edpt_addr)
endpoint_handle_t dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc, uint8_t class_code)
{
// TODO USB1 only has 4 non-control enpoint (USB0 has 5)
endpoint_handle_t const null_handle = { .coreid = 0, .xfer_type = 0, .index = 0 };
endpoint_handle_t const null_handle = { 0 };
if (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
return null_handle; // TODO not support ISO yet
@@ -418,7 +417,6 @@ endpoint_handle_t dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const
memclr_(p_qhd, sizeof(dcd_qhd_t));
p_qhd->class_code = class_code;
p_qhd->xfer_type = p_endpoint_desc->bmAttributes.xfer;
p_qhd->zero_length_termination = 1;
p_qhd->max_package_size = p_endpoint_desc->wMaxPacketSize.size;
p_qhd->qtd_overlay.next = QTD_NEXT_INVALID;
@@ -432,7 +430,6 @@ endpoint_handle_t dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const
return (endpoint_handle_t)
{
.coreid = coreid,
.xfer_type = p_endpoint_desc->bmAttributes.xfer,
.index = ep_idx,
.class_code = class_code
};
@@ -449,8 +446,6 @@ bool dcd_pipe_is_busy(endpoint_handle_t edpt_hdl)
// add only, controller virtually cannot know
static tusb_error_t pipe_add_xfer(endpoint_handle_t edpt_hdl, void * buffer, uint16_t total_bytes, bool int_on_complete)
{
ASSERT(edpt_hdl.xfer_type != TUSB_XFER_ISOCHRONOUS, TUSB_ERROR_NOT_SUPPORTED_YET);
uint8_t qtd_idx = qtd_find_free(edpt_hdl.coreid);
ASSERT(qtd_idx != 0, TUSB_ERROR_DCD_NOT_ENOUGH_QTD);
@@ -509,7 +504,6 @@ void xfer_complete_isr(uint8_t coreid, uint32_t reg_complete)
endpoint_handle_t edpt_hdl =
{
.coreid = coreid,
.xfer_type = p_qhd->xfer_type,
.index = ep_idx,
.class_code = p_qhd->class_code
};