示例#1
0
/**
 * This function is used by rt_kprintf to display a string on console.
 *
 * @param str the displayed string
 */
void rt_hw_console_output(const char* str)
{
	while (*str)
	{
		rt_hw_console_putc (*str++);
	}
}
示例#2
0
文件: board.c 项目: amigobv/stm32f107
/**
 * This function is used by rt_kprintf to display a string on console.
 *
 * @param str the displayed string
 */
void rt_hw_console_output(const char* str)
{
#if STM32_CONSOLE_USART == 0
	/* no console */
#else
	while (*str)
	{
		rt_hw_console_putc (*str++);
	}
#endif
}
示例#3
0
文件: board.c 项目: amigobv/stm32f107
/* write one character to serial, must not trigger interrupt */
static void rt_hw_console_putc(const char c)
{
	/*
		to be polite with serial console add a line feed
		to the carriage return character
	*/
	if (c=='\n')rt_hw_console_putc('\r');

	while (!(CONSOLE_USART->SR & USART_FLAG_TXE));
	CONSOLE_USART->DR = (c & 0x1FF);
}