add CDC ACM

This commit is contained in:
eddyem
2019-10-29 20:16:39 +03:00
parent 20011c92df
commit 864f8c58df
108 changed files with 181219 additions and 1 deletions

View File

@@ -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);