[platform][lpc43xx] yield during dgetc

This commit is contained in:
Brian Swetland
2015-07-30 19:57:26 -07:00
parent 855ac68ec0
commit 1da3bd7963

View File

@@ -23,6 +23,7 @@
#include <debug.h> #include <debug.h>
#include <reg.h> #include <reg.h>
#include <kernel/thread.h>
#include <platform/lpc43xx-uart.h> #include <platform/lpc43xx-uart.h>
#include <platform/lpc43xx-clocks.h> #include <platform/lpc43xx-clocks.h>
@@ -105,13 +106,16 @@ int platform_dgetc(char *c, bool wait)
if (!wait) { if (!wait) {
return -1; return -1;
} }
thread_yield();
} }
*c = readl(UART_BASE + REG_RBR); *c = readl(UART_BASE + REG_RBR);
return 0; return 0;
#else #else
if (wait) { if (wait) {
for (;;) ; for (;;) {
thread_yield();
}
} }
return -1; return -1;
#endif #endif