If you look at the Data sheet there is an interrupt called the TC (Transmit complete) interrupt that is triggered when the last bit of the last byte has been transmitted see page attached on the TC / TXE behaviour, you would just need to check for the TC bit in the UART interupt and if a Portline was defined as TXEN then just toggle it. Do you use DMA for UART transmission? don't think this would cause an issue but you world need to ensure that the TXEN line was asserted before the TXE bit was set and the first byte was loaded into the transmit buffer.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
If you look at the Data sheet there is an interrupt called the TC (Transmit complete) interrupt that is triggered when the last bit of the last byte has been transmitted see page attached on the TC / TXE behaviour, you would just need to check for the TC bit in the UART interupt and if a Portline was defined as TXEN then just toggle it. Do you use DMA for UART transmission? don't think this would cause an issue but you world need to ensure that the TXEN line was asserted before the TXE bit was set and the first byte was loaded into the transmit buffer.
1 Attachment