]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/uart_i-asm.S
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / test_src / uart_i-asm.S
index be0aee64b554cf009b7d8d67ee3a38337569cd49..67fe749d3c9a41cdbcc3756a6932816117db9488 100644 (file)
@@ -1,7 +1,7 @@
 /* uart_i-asm.S */
 /*
     This file is part of the AVR-uart_i.
-    Copyright (C) 2009  Daniel Otte (daniel.otte@rub.de)
+    Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 */
 /**
  * \file     uart_i-asm.S
- * \email    daniel.otte@rub.de
+ * \email    bg@nerilex.org
  * \author   Daniel Otte 
  * \date     2009-07-24
  * \license  GPLv3 or later
@@ -192,6 +192,11 @@ uart0_init:
        std Z+UART0_TXON_OFFSET, r24
        std Z+UART0_RXON_OFFSET, r24
 #endif 
+#if UART0_HOOK
+       std Z+UART0_HOOK_OFFSET,   r1
+       std Z+UART0_HOOK_OFFSET+1, r1
+       std Z+UART0_HOOKR_OFFSET,  r1
+#endif
        ldi r24, UBRRH_VALUE
        STORE_IO UBRR0H, r24
        ldi r24, UBRRL_VALUE
@@ -496,5 +501,16 @@ uart0_sethook:
        st X+, r25
        ret
 #endif
+
+.global uart0_flush
+uart0_flush:
+10:
+       ldi r24, lo8(uart0_ctx+UART0_CBB_TX_OFFSET)
+       ldi r25, hi8(uart0_ctx+UART0_CBB_TX_OFFSET)
+       rcall circularbytebuffer_cnt
+       tst r24
+       brne 10b
+       ret
+
        
 #endif /* UART0_I */