comparison loadtools/clmain.c @ 250:8c011177adb9

loadtools reworked to use factored-out libserial
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 21 Sep 2017 23:07:01 +0000
parents 064d4eedb3a6
children dc05170ab113
comparison
equal deleted inserted replaced
249:d0a4c05d98dc 250:8c011177adb9
5 5
6 #include <sys/types.h> 6 #include <sys/types.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <termios.h>
11 #include <unistd.h> 10 #include <unistd.h>
12 #include "baudrate.h" 11 #include "../libserial/baudrate.h"
13 #include "srecreader.h" 12 #include "srecreader.h"
14 13
15 extern char *target_ttydev; 14 char *target_ttydev;
15
16 extern struct srecreader iramimage; 16 extern struct srecreader iramimage;
17 extern char default_loadagent_image[]; 17 extern char default_loadagent_image[];
18 extern struct srecreader xramimage; 18 extern struct srecreader xramimage;
19 extern char hw_init_script[]; 19 extern char hw_init_script[];
20 extern struct baudrate baud_rate_table[]; 20 extern struct baudrate baud_rate_table[];
90 if (argc - optind >= 3) { 90 if (argc - optind >= 3) {
91 passon_argv = argv + optind + 2; 91 passon_argv = argv + optind + 2;
92 passon_argc = argc - optind - 2; 92 passon_argc = argc - optind - 2;
93 } 93 }
94 94
95 open_target_serial(); 95 open_serial_port(target_ttydev);
96 perform_compal_stage(1); 96 perform_compal_stage();
97 perform_romload(); 97 perform_romload();
98 /* loadagent should be running now */ 98 /* loadagent should be running now */
99 if (tpinterf_pass_output(1) < 0) 99 if (tpinterf_pass_output(1) < 0)
100 exit(1); 100 exit(1);
101 if (hw_init_script[0]) { 101 if (hw_init_script[0]) {