FreeCalypso > hg > freecalypso-tools
changeset 651:6bb41b4d39ed
fc-xram number of records per batch made baudrate-dependent
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 02 Mar 2020 03:39:46 +0000 (2020-03-02) |
parents | bf840c984113 |
children | d42534e5ac02 |
files | libserial-newlnx/baudrate.h libserial-newlnx/baudtab.c loadtools/chainload.c |
diffstat | 3 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libserial-newlnx/baudrate.h Mon Mar 02 03:21:41 2020 +0000 +++ b/libserial-newlnx/baudrate.h Mon Mar 02 03:39:46 2020 +0000 @@ -5,4 +5,5 @@ int termios_code; int nonstd_speed; int bootrom_code; + int xram_records; };
--- a/libserial-newlnx/baudtab.c Mon Mar 02 03:21:41 2020 +0000 +++ b/libserial-newlnx/baudtab.c Mon Mar 02 03:39:46 2020 +0000 @@ -12,16 +12,16 @@ struct baudrate baud_rate_table[] = { /* the first listed rate will be our default */ - {"115200", B115200, 0, 0}, - {"57600", B57600, 0, 1}, - {"38400", B38400, 0, 2}, - {"19200", B19200, 0, 4}, + {"115200", B115200, 0, 0, 100}, + {"57600", B57600, 0, 1, 100}, + {"38400", B38400, 0, 2, 100}, + {"19200", B19200, 0, 4, 50}, /* Non-standard high baud rates */ - {"812500", BOTHER, 812500, -1}, - {"406250", BOTHER, 406250, -1}, - {"203125", BOTHER, 203125, -1}, + {"812500", BOTHER, 812500, -1, 1000}, + {"406250", BOTHER, 406250, -1, 500}, + {"203125", BOTHER, 203125, -1, 250}, /* table search terminator */ - {NULL, B0, 0, -1}, + {NULL, B0, 0, -1, 0}, }; struct baudrate *
--- a/loadtools/chainload.c Mon Mar 02 03:21:41 2020 +0000 +++ b/loadtools/chainload.c Mon Mar 02 03:39:46 2020 +0000 @@ -9,6 +9,7 @@ #include <string.h> #include <strings.h> #include <time.h> +#include "../libserial/baudrate.h" #include "srecreader.h" extern int target_fd; @@ -71,7 +72,8 @@ exit(1); } if (!rec_count) { - printf("Each \'.\' is 100 S-records\n"); + printf("Each \'.\' is %d S-records\n", + current_baud_rate->xram_records); time(&start_time); } reclen = xramimage.datalen + 6; @@ -80,7 +82,7 @@ exit(1); } rec_count++; - if (rec_count % 100 == 0) { + if (rec_count % current_baud_rate->xram_records == 0) { scratch[0] = 0x05; /* ENQ */ write(target_fd, scratch, 1); if (collect_binblock_from_target(scratch, 3, 1))