- len = (ascii_to_nibble(buf[0]) & 0xf)<< 4;
- len |= ascii_to_nibble(buf[1]) & 0xf;
- len <<= 8;
- len |= (ascii_to_nibble(buf[2]) & 0xf)<< 4;
- len |= ascii_to_nibble(buf[3]) & 0xf;
+ printf("Flashing %d blocks", fw->fw_blocks);
+ if (debug) {
+ printf("\n");
+ } else {
+ printf(": %c", twiddlie[0]);
+ fflush(stdout);
+ }
+
+ for (block = 0; block < fw->fw_blocks; block++) {
+ len = fw->fw[block][2] << 8;
+ len |= fw->fw[block][3];
+
+ len += 4; /* block nr., length */