examples/lcd_demo/SOC-stm32f427/stm32_usart.c
static void
stm32_usart_tx_avail_cb(ringbuff_t rb, void *arg)
{
	struct stm32_usart_state *us = arg;

	if (__get_PRIMASK() != 0) {
		/*
		 * Interrupts are disabled. Use polled transmit.
		 */
		while (!ringbuff_is_empty(rb)) {
			uint8_t ch;

			ch = ringbuff_consume(us->us_app2uart);

			while (stm32_usart_tx_busy(us->us_regs))
				;
			us->us_regs->TDR = (uint32_t) ch;
		}
		ringbuff_consume_done(us->us_app2uart);
	} else {
		stm32_usart_tx_irq_enable(us->us_regs);
	}
}
/*
 * Invoked whenever data is received from the application and has
 * been loaded into the ring buffer.
 */
Invoked whenever data is received from the application and has
been loaded into the ring buffer.
Invoked whenever data is received from the application and has been loaded into the ring buffer .
static void
stm32_usart_tx_avail_cb(ringbuff_t rb, void *arg)
{
	struct stm32_usart_state *us = arg;
	if (__get_PRIMASK() != 0) {
		while (!ringbuff_is_empty(rb)) {
			uint8_t ch;
			ch = ringbuff_consume(us->us_app2uart);
			while (stm32_usart_tx_busy(us->us_regs))
				;
			us->us_regs->TDR = (uint32_t) ch;
		}
		ringbuff_consume_done(us->us_app2uart);
	} else {
		stm32_usart_tx_irq_enable(us->us_regs);
	}
}
static void stm32_usart_tx_avail_cb ( ringbuff_t rb , void * arg ) { struct stm32_usart_state * us = arg ; if ( __get_PRIMASK ( ) != 0 ) { while ( ! ringbuff_is_empty ( rb ) ) { uint8_t ch ; ch = ringbuff_consume ( us -> us_app2uart ) ; while ( stm32_usart_tx_busy ( us -> us_regs ) ) ; us -> us_regs -> TDR = ( uint32_t ) ch ; } ringbuff_consume_done ( us -> us_app2uart ) ; } else { stm32_usart_tx_irq_enable ( us -> us_regs ) ; } }
Invoked whenever data is received from the application and has
 been loaded into the ring buffer.
Invoked whenever data is received from the application and has been loaded into the ring buffer .
/*
		 * Interrupts are disabled. Use polled transmit.
		 */