/* 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
*/
/**
* \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
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
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 */