X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fuart_i-asm.S;h=67fe749d3c9a41cdbcc3756a6932816117db9488;hp=be0aee64b554cf009b7d8d67ee3a38337569cd49;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=27f4804c185ae24b3b6367bb2fdb898d6692d0f6 diff --git a/test_src/uart_i-asm.S b/test_src/uart_i-asm.S index be0aee6..67fe749 100644 --- a/test_src/uart_i-asm.S +++ b/test_src/uart_i-asm.S @@ -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 */