From 7ea135733618571635fefba6c986e8890f97b437 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 21 Apr 2006 13:58:51 +0000 Subject: [PATCH] MFp4: Make getc(0) polling (this has the happy side effect of saving 8 bytes in the generated code). --- sys/boot/arm/at91/libat91/getc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/boot/arm/at91/libat91/getc.c b/sys/boot/arm/at91/libat91/getc.c index c86183b4dc5d..e0a43b9b9a65 100644 --- a/sys/boot/arm/at91/libat91/getc.c +++ b/sys/boot/arm/at91/libat91/getc.c @@ -53,10 +53,10 @@ getc(int seconds) thisSecond = GetSeconds(); seconds = thisSecond + seconds; - while (thisSecond <= seconds) { + do { if ((pUSART->US_CSR & AT91C_US_RXRDY)) return (pUSART->US_RHR & 0xFF); thisSecond = GetSeconds(); - } + } while (thisSecond < seconds); return (-1); }