support for binaries usinf -b, BUT: dirty dirty slow slow fucked up code! i mean it!
[my-code/arm.git] / betty / fwflash.c
index ebf7190..fd8d31b 100644 (file)
@@ -313,6 +313,9 @@ int flash_write(u32 addr,u16 data) {
 
        u16 check;
 
+       if(data==0xffff)
+               return 0;
+
        *((unsigned volatile short *)addr)=0xa0;
        *((unsigned volatile short *)addr)=data;
        while(1) {
@@ -364,7 +367,8 @@ int receive_data_and_write_to_flash(u32 addr,u32 datalen) {
        unlock_bypass_reset(bank);
 
        /* modify cksm on purpose, so the user knows ... */
-       cksm+=1;
+       if(ret==-1)
+               cksm+=1;
 
        /* send the cksm */
        uart0_send_byte(cksm);