refractor dcd_pipe_control_write_zero_length to use dcd_pipe_control_write
This commit is contained in:
parent
d55f9ecef1
commit
049a22f2cc
|
@ -177,6 +177,7 @@ void dcd_isr(uint8_t coreid)
|
|||
if (device_int_status & DEV_INT_ERROR_MASK)
|
||||
{
|
||||
uint32_t error_status = sie_command_read(SIE_CMDCODE_READ_ERROR_STATUS, 1);
|
||||
(void) error_status;
|
||||
// ASSERT(false, (void) 0);
|
||||
}
|
||||
|
||||
|
@ -240,6 +241,10 @@ void dcd_device_set_address(uint8_t coreid, uint8_t dev_addr)
|
|||
|
||||
tusb_error_t dcd_pipe_control_write(uint8_t coreid, void const * buffer, uint16_t length)
|
||||
{
|
||||
(void) coreid; // suppress compiler warning
|
||||
|
||||
ASSERT( length !=0 || buffer == NULL, TUSB_ERROR_INVALID_PARA);
|
||||
|
||||
LPC_USB->USBCtrl = SLAVE_CONTROL_WRITE_ENABLE_MASK; // logical endpoint = 0
|
||||
LPC_USB->USBTxPLen = length;
|
||||
|
||||
|
@ -264,13 +269,7 @@ tusb_error_t dcd_pipe_control_read(uint8_t coreid)
|
|||
|
||||
void dcd_pipe_control_write_zero_length(uint8_t coreid)
|
||||
{
|
||||
LPC_USB->USBCtrl = SLAVE_CONTROL_WRITE_ENABLE_MASK; // logical endpoint = 0
|
||||
LPC_USB->USBTxPLen = 0;
|
||||
|
||||
LPC_USB->USBCtrl = 0;
|
||||
|
||||
sie_command_write(SIE_CMDCODE_ENDPOINT_SELECT+1, 0, 0); // select control IN endpoint
|
||||
sie_command_write(SIE_CMDCODE_BUFFER_VALIDATE, 0, 0);
|
||||
dcd_pipe_control_write(coreid, NULL, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -92,6 +92,9 @@ void std_get_descriptor(uint8_t coreid)
|
|||
dcd_pipe_control_write(coreid, &app_tusb_desc_device, sizeof(tusb_descriptor_device_t));
|
||||
break;
|
||||
|
||||
case TUSB_DESC_TYPE_CONFIGURATION:
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue