]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
buggy revision warning
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Wed, 29 Jul 2009 14:57:10 +0000 (14:57 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Wed, 29 Jul 2009 14:57:10 +0000 (14:57 +0000)
WARNING-BUGGY-VERSION [new file with mode: 0644]
test_src/cli-core.S
test_src/cli-stub.c
test_src/nessie_common.h
test_src/setbaud_asm.inc
test_src/string-extras-asm.S
test_src/uart_i-asm.S

diff --git a/WARNING-BUGGY-VERSION b/WARNING-BUGGY-VERSION
new file mode 100644 (file)
index 0000000..5de2c7c
--- /dev/null
@@ -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
index f074b045c6275b8183239f7371908bf31971bdb1..cbe97600cbe8860626c8b5067fffafe156186129 100644 (file)
@@ -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+
index ec6ac1d21277f69ef4fcd5c3bfaff8dacf66e160..c1194c1cbe733283dc60a7f674e15e533464ab3c 100644 (file)
 
 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"
-                         " <command> - <params> - <address>\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
index b2d2b14cb516cd6884c214d2e82949e47355d99c..65b05b6b190cf8abe58fe785daad1b858814f114 100644 (file)
@@ -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);
index a68832ee4ca114a2c0c86cbe91b1a5522132430b..b472a88297e5678f022cb7c4237bc6833a0ba16a 100644 (file)
  */
 
 #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)
index c40e442b6c1d56ef2027b13e0158718286cfb09e..256ecd7a3279bd37965630fcd6a51a34dcabbcb0 100644 (file)
@@ -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
                
index 8ce866b4280acf438146833d0f9f57b95d38a1e1..e310a48d199744407fb1bd28a849bb405cfcef36 100644 (file)
 #include <avr/io.h>
 #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 */