- memset(out, 0, sizeof(out));
- outp = out;
- *outp++ = (pkt >> 8) & 0xff;
- *outp++ = pkt & 0xff;
- *outp++ = (len >> 8) & 0xff;
- *outp++ = len & 0xff;
- for (i = 0; i < r; i+=2) {
- *outp = (ascii_to_nibble(buf[i]) & 0xf)<< 4;
- *outp |= ascii_to_nibble(buf[i+1]) & 0xf;
- outp++;
- }
- cnt = outp - out;
- printf("Flashing %d bytes...\n", cnt);