Blinkinlabs / ch554_sdcc

CH554 software development kit for SDCC
295 stars 70 forks source link

bug in UART ISR #25

Closed nerdralph closed 3 years ago

nerdralph commented 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

nerdralph commented 3 years ago

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.