X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fuart_lowlevel.c;h=c0ea703b5425a59970264b09dead9a3a3bb578c9;hb=7390f9235d6bc08b7fe34a5f43a04bd3b58f6ea6;hp=2261ebbf2c8572ff4c9774463c9848fb67a2bd16;hpb=5e75eafde9b0269aa78395bbeb3e79ff36a1f082;p=arm-crypto-lib.git diff --git a/test_src/uart_lowlevel.c b/test_src/uart_lowlevel.c index 2261ebb..c0ea703 100644 --- a/test_src/uart_lowlevel.c +++ b/test_src/uart_lowlevel.c @@ -1,6 +1,6 @@ /* uart_lowlevel.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -180,3 +180,11 @@ uint32_t uart_dataavail(uint8_t uartno){ /* wait while the FIFO is empty */ return(HW_REG(uart_base[uartno]+UARTFR_OFFSET)&_BV(UART_RXFE))?0:1; } + +void uart_flush(uint8_t uartno){ + if(uartno>UART_MAX){ + return; + } + while((HW_REG(uart_base[uartno]+UARTCTL_OFFSET)&_BV(UART_EOT)) == 0) + ; +}