comparison loadtools/flerase.c @ 205:cd12d1049f91

fc-loadtool: flash ID check moved into flash info, added to erase and program
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 23 Dec 2013 18:40:04 +0000
parents 6fb41cfa773d
children f027c6fbe37e
comparison
equal deleted inserted replaced
204:61c7480b3c50 205:cd12d1049f91
95 /* now enforce sector alignment for both offset and length */ 95 /* now enforce sector alignment for both offset and length */
96 if (get_flash_sector_table(bank) < 0) 96 if (get_flash_sector_table(bank) < 0)
97 return(-1); 97 return(-1);
98 if (get_flash_sector_range(bi, offset, len, &startsec, &endsec) < 0) 98 if (get_flash_sector_range(bi, offset, len, &startsec, &endsec) < 0)
99 return(-1); 99 return(-1);
100 stat = flash_id_check(bank, 0);
101 if (stat)
102 return(stat);
100 printf("Erasing %d sector(s)\n", endsec - startsec); 103 printf("Erasing %d sector(s)\n", endsec - startsec);
101 for (sp = startsec; sp < endsec; sp++) { 104 for (sp = startsec; sp < endsec; sp++) {
102 stat = do_sector_erase(bi, sp); 105 stat = do_sector_erase(bi, sp);
103 if (stat) 106 if (stat)
104 return(stat); 107 return(stat);