X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fuart_i-asm.S;h=e310a48d199744407fb1bd28a849bb405cfcef36;hp=8ce866b4280acf438146833d0f9f57b95d38a1e1;hb=a5cb349f9d72e0d2c82730647b4f142de6b7e485;hpb=cccb1d3e008592ad7e4b57653afb95deb4d4a2c5 diff --git a/test_src/uart_i-asm.S b/test_src/uart_i-asm.S index 8ce866b..e310a48 100644 --- a/test_src/uart_i-asm.S +++ b/test_src/uart_i-asm.S @@ -29,10 +29,28 @@ #include #include "config.h" #include "avr-asm-macros.S" +#include "uart_defs.h" #define XON_VALUE 0x11 #define XOFF_VALUE 0x13 +#if UART0_I + +#ifndef UART0_PARATY +# warning "UART0: using default paraty: 'none'" +# define UART0_PARATY UART_PARATY_NONE +#endif + +#ifndef UART0_STOPBITS +# warning "UART0: using default ammount of stop bits: '1'" +# define UART0_STOPBITS UART_STOPBITS_1 +#endif + +#ifndef UART0_DATABITS +# warning "UART0: using default ammount of data bits: '8'" +# define UART0_DATABITS UART_DATABITS_8 +#endif + #ifdef UDR # define OLD_UART # ifdef UDR0 @@ -310,8 +328,9 @@ uart0_putc: */ .global USART0_RX_vect USART0_RX_vect: + push_range 0, 1 push_range 16, 31 - in r21, _SFR_IO_ADDR(SREG) + in r18, _SFR_IO_ADDR(SREG) LOAD_IO r24, UDR0 #if UART0_SWFLOWCTRL ldi r26, lo8(uart0_ctx+UART0_TXON_OFFSET) @@ -368,8 +387,8 @@ uart0_putc: ldi r23, hi8(uart0_ctx+UART0_CBB_TX_OFFSET) ldi r30, lo8(uart0_ctx+UART0_RXON_OFFSET) ldi r31, hi8(uart0_ctx+UART0_RXON_OFFSET) - ld r21, Z - tst r21 + ld r16, Z + tst r16 breq 60f cpi r24, UART0_THRESH_HIGH+1 brlo 99f @@ -387,8 +406,9 @@ uart0_putc: SET_BIT_IO UCSR0B, UDRIE0, r24 #endif /* UART0_SWFLOWCTRL */ 99: - out _SFR_IO_ADDR(SREG), r21 + out _SFR_IO_ADDR(SREG), r18 pop_range 16, 31 + pop_range 0, 1 reti /******************************************************************************/ @@ -415,6 +435,7 @@ uart0_putc: movw r24, r22 cli rcall circularbytebuffer_get_fifo + clr r25 reti /******************************************************************************/ @@ -445,3 +466,4 @@ uart0_sethook: ret #endif +#endif /* UART0_I */