[stm32] have the debug io code call into the uart drivers

This commit is contained in:
Travis Geiselbrecht
2012-07-17 09:58:26 -07:00
parent d5f30da9df
commit 7329c1d328

View File

@@ -24,7 +24,6 @@
#include <reg.h>
#include <debug.h>
#include <printf.h>
#include <lib/cbuf.h>
#include <kernel/thread.h>
#include <platform/debug.h>
#include <arch/ops.h>
@@ -34,8 +33,6 @@
#include <stm32f10x_usart.h>
#include <arch/arm/cm3.h>
static cbuf_t debug_rx_buf;
void stm32_debug_early_init(void)
{
uart_init_early();
@@ -49,10 +46,18 @@ void stm32_debug_init(void)
void _dputc(char c)
{
if (c == '\n')
uart_putc(DEBUG_UART, '\r');
uart_putc(DEBUG_UART, c);
}
int dgetc(char *c, bool wait)
{
int ret = uart_getc(DEBUG_UART, wait);
if (ret == -1)
return -1;
*c = ret;
return 0;
}
void platform_halt(void)