detects and displays S0 field correctly now

This commit is contained in:
Markus Fröschle
2013-11-08 08:18:03 +00:00
parent d85ef98ded
commit efdd513be3

View File

@@ -119,7 +119,6 @@ static uint8_t checksum(uint8_t arr[])
return ~checksum; return ~checksum;
} }
#ifdef _NOT_USED_
void print_record(uint8_t *arr) void print_record(uint8_t *arr)
{ {
switch (SREC_TYPE(arr)) switch (SREC_TYPE(arr))
@@ -151,7 +150,6 @@ void print_record(uint8_t *arr)
break; break;
} }
} }
#endif /* _NOT_USED_ */
/* /*
* convert an S-record line into its corresponding byte vector (ASCII->binary) * convert an S-record line into its corresponding byte vector (ASCII->binary)
@@ -175,6 +173,11 @@ static void line_to_vector(uint8_t *buff, uint8_t *vector)
} }
} }
static void vector_to_line(uint8_t *vector, uint8_t *buff)
{
sprintf(buff, "S");
}
/* /*
* read and parse a Motorola S-record file and copy contents to dst. The theory of operation is to read and parse the S-record file * read and parse a Motorola S-record file and copy contents to dst. The theory of operation is to read and parse the S-record file
* and to use the supplied callback routine to copy the buffer to the destination once the S-record line is converted. * and to use the supplied callback routine to copy the buffer to the destination once the S-record line is converted.
@@ -276,6 +279,7 @@ int main(int argc, char *argv[])
printf("version: %d, revision %d\n", printf("version: %d, revision %d\n",
* (unsigned short *)((char *) SREC_DATA16(vector) + length), * (unsigned short *)((char *) SREC_DATA16(vector) + length),
* (unsigned short *)((char *) SREC_DATA16(vector) + length + 1)); * (unsigned short *)((char *) SREC_DATA16(vector) + length + 1));
print_record(vector);
break; break;