Closed nerdralph closed 3 years ago
U1TI should be cleared in the ISR. After the first transmit interrupt, the ISR will run repeatedly, only running one instruction after reti before running the ISR again. https://github.com/Blinkinlabs/ch554_sdcc/blob/master/examples/usb_device_cdc/main.c#L546
I did some debugging and figured out that CH554UART1SendByte busy waits for U1TI then clears it, so there is no bug. I may yet re-write the code so it doesn't busy loop, but rather clears U1TI in the serial ISR.
U1TI should be cleared in the ISR. After the first transmit interrupt, the ISR will run repeatedly, only running one instruction after reti before running the ISR again. https://github.com/Blinkinlabs/ch554_sdcc/blob/master/examples/usb_device_cdc/main.c#L546