Both functions passed a flag constant (USART_FLAG_TXE) to
USART_GetITStatus() and span while TXE was set - but TXE being set
means the data register is already empty, so the loop exited
immediately with data still queued in the software FIFO and shifting
out of the USART. flush therefore never waited at all.
Wait for the software TX FIFO to drain and then for the TC flag, which
indicates the shift register has actually emptied.
Enables neater connection to erroneous boards with only 3 pins on USART2 like the one I have!
USART1 is now the default for Nextion serial repeater unless you define STM32_USART1_HOST or ZUMSPOT_LIBRE in Config.h
Needed to specify ZUMSPOT_LIBRE as separate board in Config.h as this only has a header for USART2 - Libre Kit will not use these changes.
All other boards appear to break out all USARTs in some form or other (specifically USART1)
EA7GIB's boards will now have a minor labelling error in that the header labelled Nextion (USART2) is no longer the Nextion port unless you define STM32_USART1_HOST or ZUMSPOT_LIBRE in Config.h. If like me your OCD triggers with this, define ZUMSPOT_LIBRE and the nextion will be forced to USART2 (as labelled!)