]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - test_src/uart_lowlevel.c
switching to dedicated endian switching function
[arm-crypto-lib.git] / test_src / uart_lowlevel.c
index 2261ebbf2c8572ff4c9774463c9848fb67a2bd16..c0ea703b5425a59970264b09dead9a3a3bb578c9 100644 (file)
@@ -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)
+               ;
+}