The asynchronous interaction between interrupt handler code and application code can be quite subtle. Notice that we set TxPrimed before reenabling the interrupt. If the order were reversed it would be possible for the newly enabled interrupt handler to empty the transmit queue and clear TxPrimed before the application set TxPrimed, thus losing the signal from the handler to the application code. Admittedly, the USART is sufficiently slow that this scenario is unlikely, but with interrupt code it pays to program defensively.