comparison loadtools/bpmain.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 96332d875fc9
children aba969153d20
comparison
equal deleted inserted replaced
249:d0a4c05d98dc 250:8c011177adb9
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include "srecreader.h" 10 #include "srecreader.h"
11 11
12 extern char *target_ttydev; 12 char *target_ttydev;
13
13 extern struct srecreader iramimage; 14 extern struct srecreader iramimage;
14 extern char default_buzplayer_image[]; 15 extern char default_buzplayer_image[];
15 extern void (*default_exit)(); 16 extern void (*default_exit)();
16 extern int gta_modem_poweron; 17 extern int gta_modem_poweron;
17 18
68 goto usage; 69 goto usage;
69 target_ttydev = argv[optind]; 70 target_ttydev = argv[optind];
70 if (!iramimage.filename) 71 if (!iramimage.filename)
71 iramimage.filename = default_buzplayer_image; 72 iramimage.filename = default_buzplayer_image;
72 73
73 open_target_serial(); 74 open_serial_port(target_ttydev);
74 if (reattach) 75 if (reattach)
75 switch_baud_rate(reattach); 76 set_serial_baudrate(reattach);
76 else { 77 else {
77 perform_compal_stage(1); 78 perform_compal_stage();
78 perform_romload(); 79 perform_romload();
79 putchar('\n'); 80 putchar('\n');
80 if (tpinterf_pass_output(1) < 0) 81 if (tpinterf_pass_output(1) < 0)
81 exit(1); 82 exit(1);
82 putchar('\n'); 83 putchar('\n');