X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=betty%2Ffwflash.c;h=85a64fa8e95458097e129742d509fcfeca1d8e3c;hb=d7ff99dcff9f0f615da9f491b7b7d2c1629bdcf2;hp=ebf7190590310a7e287ae079335b23a241f80ce4;hpb=e013de8b92ff7ba9cf70c7c8669c023a315f1348;p=my-code%2Farm.git diff --git a/betty/fwflash.c b/betty/fwflash.c index ebf7190..85a64fa 100644 --- a/betty/fwflash.c +++ b/betty/fwflash.c @@ -272,8 +272,11 @@ void flash_chip_erase(u8 bank) { else status=B2F; - if(status&0x80) + if(status&0x80) { + /* send an ack */ + uart0_send_byte(status); break; + } } } @@ -313,6 +316,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) { @@ -348,11 +354,9 @@ int receive_data_and_write_to_flash(u32 addr,u32 datalen) { ret=0; for(i=0;i