Changeset 579 for trunk/82802ab.c
- Timestamp:
- Jun 5, 2009 8:32:07 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/82802ab.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/82802ab.c
r578 r579 28 28 29 29 #include <string.h> 30 #include <stdlib.h> 30 31 #include "flash.h" 31 32 … … 173 174 int page_size = flash->page_size; 174 175 chipaddr bios = flash->virtual_memory; 175 176 uint8_t *tmpbuf = malloc(page_size); 177 178 if (!tmpbuf) { 179 printf("Could not allocate memory!\n"); 180 exit(1); 181 } 176 182 printf("Programming page: \n"); 177 183 for (i = 0; i < total_size / page_size; i++) { … … 187 193 * sudden power off situations 188 194 */ 189 if (!memcmp((void *)(buf + i * page_size),190 (void *)(bios + i * page_size), page_size)) {195 chip_readn(tmpbuf, bios + i * page_size, page_size); 196 if (!memcmp((void *)(buf + i * page_size), tmpbuf, page_size)) { 191 197 printf("SKIPPED\n"); 192 198 continue; … … 200 206 printf("\n"); 201 207 protect_jedec(bios); 208 free(tmpbuf); 202 209 203 210 return 0;
Note: See TracChangeset
for help on using the changeset viewer.
