FreeCalypso > hg > freecalypso-tools
comparison loadtools/labaud.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 | e7502631a0f9 |
children |
comparison
equal
deleted
inserted
replaced
249:d0a4c05d98dc | 250:8c011177adb9 |
---|---|
3 * in coordination with loadagent. | 3 * in coordination with loadagent. |
4 */ | 4 */ |
5 | 5 |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <termios.h> | |
9 #include <unistd.h> | 8 #include <unistd.h> |
10 #include "baudrate.h" | 9 #include "../libserial/baudrate.h" |
11 | 10 |
12 extern int target_fd; | 11 extern int target_fd; |
13 extern struct baudrate *current_baud_rate; | 12 extern struct baudrate *current_baud_rate; |
14 extern struct baudrate *find_baudrate_by_name(); | 13 extern struct baudrate *find_baudrate_by_name(); |
15 | 14 |
24 argv[1] = newbr->name; | 23 argv[1] = newbr->name; |
25 argv[2] = 0; | 24 argv[2] = 0; |
26 tpinterf_make_cmd(argv); | 25 tpinterf_make_cmd(argv); |
27 if (tpinterf_send_cmd() < 0) | 26 if (tpinterf_send_cmd() < 0) |
28 return(-1); | 27 return(-1); |
29 switch_baud_rate(newbr); | 28 set_serial_baudrate(newbr); |
30 usleep(150000); | 29 usleep(150000); |
31 write(target_fd, &U, 1); | 30 write(target_fd, &U, 1); |
32 return tpinterf_pass_output(1); | 31 return tpinterf_pass_output(1); |
33 } | 32 } |
34 | 33 |