/* Delay for half of the software UART baudrate period using the timer assigned to the software UART. Load the timer, start counting, wait vfor the timer interrupt and then deactivate the timer. */
static void swuart_delay(struct swuart_dev *dev, uint32_t usec)
/* Delay for half of the software UART baudrate period using the timer assigned to the software UART. Load the timer, start counting, wait vfor the timer interrupt and then deactivate the timer. */
static void swuart_delay(struct swuart_dev *dev, uint32_t usec)
{
	NVIC_EnableIRQ(TMR1_EVT_IRQn);
	delay_flag = usec;
	while(delay_flag != 0);
	NVIC_DisableIRQ(TMR1_EVT_IRQn);
}