From a5cb349f9d72e0d2c82730647b4f142de6b7e485 Mon Sep 17 00:00:00 2001 From: bg Date: Wed, 29 Jul 2009 14:57:10 +0000 Subject: [PATCH] buggy revision warning --- WARNING-BUGGY-VERSION | 15 +++++++++++ test_src/cli-core.S | 3 +++ test_src/cli-stub.c | 48 ++++-------------------------------- test_src/nessie_common.h | 5 +--- test_src/setbaud_asm.inc | 4 +-- test_src/string-extras-asm.S | 6 ++--- test_src/uart_i-asm.S | 30 +++++++++++++++++++--- 7 files changed, 55 insertions(+), 56 deletions(-) create mode 100644 WARNING-BUGGY-VERSION diff --git a/WARNING-BUGGY-VERSION b/WARNING-BUGGY-VERSION new file mode 100644 index 0000000..5de2c7c --- /dev/null +++ b/WARNING-BUGGY-VERSION @@ -0,0 +1,15 @@ + The current version of the AVR-Crypto-Lib is BUGGY +==================================================== + +This is due to our afford of integrating newly optimized versions of the +UART interface and the cli tools. + +We are working on this problem. + +Please use a revision prior to 2009-07-28. +This means use + svn revisions up to revision 2832 and + bzr revisions up to revision 67 + +best regards, + Daniel Otte diff --git a/test_src/cli-core.S b/test_src/cli-core.S index f074b04..cbe9760 100644 --- a/test_src/cli-core.S +++ b/test_src/cli-core.S @@ -277,6 +277,9 @@ cli_option_listing: call strlen sbiw r24, 1 movw LEN_0, r24 + brpl 1f + clr LEN_0 + clr LEN_1 1: movw r30, LST_0 lpm r24, Z+ diff --git a/test_src/cli-stub.c b/test_src/cli-stub.c index ec6ac1d..c1194c1 100644 --- a/test_src/cli-stub.c +++ b/test_src/cli-stub.c @@ -38,52 +38,14 @@ cli_rx_fpt cli_rx = NULL; cli_tx_fpt cli_tx = NULL; -uint8_t cli_echo=1; +uint8_t cli_echo = 1; -void echo_ctrl(char* s); +void echo_ctrl(char* s); uint16_t max_cmd_length(PGM_VOID_P cmdlist); -int8_t search_and_call(char* cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist); -void cli_option_listing(char* buffer, PGM_VOID_P cmdlist); - +int8_t search_and_call(char* cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist); +void cli_option_listing(char* buffer, PGM_VOID_P cmdlist); +void cli_auto_help(uint16_t maxcmdlength, PGM_VOID_P cmdlist); -void cli_auto_help(uint16_t maxcmdlength, PGM_VOID_P cmdlist);/* -{ - cmdlist_entry_t item; - uint16_t i; - if(!cli_tx) - return; - - cli_putstr_P(PSTR("\r\n[auto help] available commands:\r\n" - " - -
\r\n")); - for(;;){ - item.cmd_name = (void*)pgm_read_word(cmdlist+0); - item.cmd_param_str = (void*)pgm_read_word(cmdlist+2); - item.cmd_function = (void_fpt)pgm_read_word(cmdlist+4); - cmdlist = (uint8_t*)cmdlist+CMDLIST_ENTRY_SIZE; - if(item.cmd_name==NULL){ - return; - } - cli_tx(' '); - cli_putstr_P(item.cmd_name); - i=maxcmdlength-strlen_P(item.cmd_name); - while(i--) - cli_tx(' '); - cli_putstr_P(PSTR(" - ")); - if(item.cmd_param_str==NULL){ - cli_putstr_P(PSTR("none \t- 0x")); - } else { - if(item.cmd_param_str==(void*)1){ - cli_putstr_P(PSTR("yes \t- 0x")); - } else { - cli_putstr_P(item.cmd_param_str); - cli_putstr_P(PSTR(" \t- 0x")); - } - } - cli_hexdump_rev(&item.cmd_function, 2); - cli_putstr_P(PSTR("\r\n")); - } -} -*/ typedef void(*str_fpt)(char*); #define CLI_ENTER 13 #define CLI_BACKSPACE 8 diff --git a/test_src/nessie_common.h b/test_src/nessie_common.h index b2d2b14..65b05b6 100644 --- a/test_src/nessie_common.h +++ b/test_src/nessie_common.h @@ -52,10 +52,7 @@ void nessie_send_alive_a(uint16_t i); #define NESSIE_PUTSTR cli_putstr #define NESSIE_PUTSTR_P cli_putstr_P #else -#include "uart.h" -#define NESSIE_PUTC uart_putc -#define NESSIE_PUTSTR uart_putstr -#define NESSIE_PUTSTR_P uart_putstr_P +# error "direct uart output removed for nessie" #endif void nessie_print_block(uint8_t* block, uint16_t blocksize_bit); diff --git a/test_src/setbaud_asm.inc b/test_src/setbaud_asm.inc index a68832e..b472a88 100644 --- a/test_src/setbaud_asm.inc +++ b/test_src/setbaud_asm.inc @@ -22,11 +22,11 @@ */ #ifndef F_CPU -# error "uart_ni requires F_CPU to be defined" +# error "uart_i requires F_CPU to be defined" #endif #ifndef BAUD -# error "uart_ni requires UART0_BAUD_RATE to be defined" +# error "uart_i requires UART0_BAUD_RATE to be defined" #endif #if !(F_CPU) diff --git a/test_src/string-extras-asm.S b/test_src/string-extras-asm.S index c40e442..256ecd7 100644 --- a/test_src/string-extras-asm.S +++ b/test_src/string-extras-asm.S @@ -46,9 +46,9 @@ stridentcnt_P: ld r22, X+ lpm r23, Z+ cpse r22, r23 - ret - cpse r22, r1 - ret +2: ret + tst r22 + breq 2b adiw r24, 1 rjmp 1b 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 */ -- 2.39.2