Merge branch 'master' into remove-dcd-set-config

This commit is contained in:
hathach
2020-04-17 13:38:22 +07:00
118 changed files with 1010 additions and 669 deletions

View File

@@ -181,9 +181,7 @@ void dcd_init(uint8_t rhport)
LPC_USB->UDCAH = (uint32_t) _dcd.udca;
LPC_USB->DMAIntEn = (DMA_INT_END_OF_XFER_MASK /*| DMA_INT_NEW_DD_REQUEST_MASK*/ | DMA_INT_ERROR_MASK);
sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 1); // connect
// USB IRQ priority should be set by application previously
// Clear pending IRQ
NVIC_ClearPendingIRQ(USB_IRQn);
}
@@ -221,6 +219,18 @@ void dcd_remote_wakeup(uint8_t rhport)
(void) rhport;
}
void dcd_connect(uint8_t rhport)
{
(void) rhport;
sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, SIE_DEV_STATUS_CONNECT_STATUS_MASK);
}
void dcd_disconnect(uint8_t rhport)
{
(void) rhport;
sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 0);
}
//--------------------------------------------------------------------+
// CONTROL HELPER
//--------------------------------------------------------------------+
@@ -498,7 +508,7 @@ static void dd_complete_isr(uint8_t rhport, uint8_t ep_id)
}
// main USB IRQ handler
void dcd_irq_handler(uint8_t rhport)
void dcd_int_handler(uint8_t rhport)
{
uint32_t const dev_int_status = LPC_USB->DevIntSt & LPC_USB->DevIntEn;
LPC_USB->DevIntClr = dev_int_status;// Acknowledge handled interrupt