mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-03-20 08:40:57 +03:00
add CDC ACM
This commit is contained in:
@@ -347,10 +347,11 @@ static uint16_t EP0_Handler(ep_t ep){
|
||||
epstatus = SET_STALL_TX(epstatus);
|
||||
} else if (ep.tx_flag){ // package transmitted
|
||||
// now we can change address after enumeration
|
||||
if ((USB->DADDR & USB_DADDR_ADD) != USB_Dev.USB_Addr){
|
||||
if(USB_Dev.USB_Addr){
|
||||
USB->DADDR = USB_DADDR_EF | USB_Dev.USB_Addr;
|
||||
// change state to ADRESSED
|
||||
USB_Dev.USB_Status = USB_ADRESSED_STATE;
|
||||
USB_Dev.USB_Addr = 0; // clear address for re-enumeration
|
||||
}
|
||||
// end of transaction
|
||||
epstatus = CLEAR_DTOG_RX(epstatus);
|
||||
|
||||
Reference in New Issue
Block a user