Re:UART Tx Interrupt
It would be nice if UART generated a tx complete interrupt. The trigger level interrupt is no good since UART baud rate can be so variable.
I'm currently calculating predicted completion time - based on baudrate, wordsize and number of bytes tx'd. Then feeding this into an interrupt generater, that fires at this predicted time, and calls function to check busy flag. The interrupt can refire at user frequency until tx is complete, but should get it on first or second poll.
This is good for half-duplex mode since can trigger user callback function on tx complete to change tx -> rx modes in RF comms say, and is very accurate.
I'm incorporating this functionality into timerUtils module, and will post.
login or register to reply
|