comparison loadtools/romload.c @ 50:f1df95eed62c

loadtools: -b option works in fc-iram
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 23 Jun 2013 03:32:04 +0000
parents 54392d1ea474
children ccc5161848c7
comparison
equal deleted inserted replaced
49:54392d1ea474 50:f1df95eed62c
19 extern int errno; 19 extern int errno;
20 20
21 extern char *target_ttydev; 21 extern char *target_ttydev;
22 extern int target_fd; 22 extern int target_fd;
23 extern struct baudrate baud_rate_table[]; 23 extern struct baudrate baud_rate_table[];
24 extern struct baudrate *find_baudrate_by_name();
24 25
25 struct srecreader iramimage; 26 struct srecreader iramimage;
26 struct baudrate *romload_baud_rate = baud_rate_table; /* 1st entry default */ 27 struct baudrate *romload_baud_rate = baud_rate_table; /* 1st entry default */
27 28
28 static int beacon_interval = 13; /* in milliseconds */ 29 static int beacon_interval = 13; /* in milliseconds */
66 if (i < 2 || i > 500) { 67 if (i < 2 || i > 500) {
67 fprintf(stderr, "invalid -i argument specified\n"); 68 fprintf(stderr, "invalid -i argument specified\n");
68 exit(1); 69 exit(1);
69 } 70 }
70 beacon_interval = i; 71 beacon_interval = i;
72 }
73
74 /*
75 * The following function should be called by command line option
76 * parsers upon encountering the -b option.
77 */
78 set_romload_baudrate(arg)
79 char *arg;
80 {
81 struct baudrate *br;
82
83 br = find_baudrate_by_name(arg);
84 if (!br)
85 exit(1); /* error msg already printed */
86 if (br->bootrom_code < 0) {
87 fprintf(stderr,
88 "baud rate of %s is not supported by the Calypso boot ROM\n",
89 br->name);
90 exit(1);
91 }
92 romload_baud_rate = br;
71 } 93 }
72 94
73 /* 95 /*
74 * The following functions alter some of the parameters sent to the 96 * The following functions alter some of the parameters sent to the
75 * boot ROM in the <p command. 97 * boot ROM in the <p command.