1
0
Fork 0

More attempts to stop termios

This commit is contained in:
Shawn Nock 2020-01-16 13:51:14 -05:00
parent bb1a94f020
commit 2c9da64f19
2 changed files with 4 additions and 8 deletions

View File

@ -39,7 +39,10 @@ int main(int argc, char **argv) {
int serial_fd = serial_init(serial_port, speed); int serial_fd = serial_init(serial_port, speed);
serial_flush(serial_fd); serial_flush(serial_fd);
if (!strcmp(speed, "0")) {
printf("Serial initialized, press any key to continue.\n");
getc(stdin);
}
uint8_t rem = (uint8_t)(argc - optind); uint8_t rem = (uint8_t)(argc - optind);
if (rem) { if (rem) {
if (strcmp(argv[optind], "image") == 0) { if (strcmp(argv[optind], "image") == 0) {

View File

@ -25,8 +25,6 @@ speed_from_string(char const *s)
return DEFAULT_SPEED; return DEFAULT_SPEED;
} }
switch (speed) { switch (speed) {
case 0:
return B0;
case 9600: case 9600:
return B9600; return B9600;
case 115200: case 115200:
@ -57,13 +55,8 @@ serial_init(char const *serial_port, char const *speed)
strerror(errno)); strerror(errno));
exit(ERR_SERIAL_PORT); exit(ERR_SERIAL_PORT);
} }
if (!strcmp(speed, "0")) {
// Skip setup on special baud to allow manual register twidling
return serial_fd;
}
struct termios t_options; struct termios t_options;
if (tcgetattr(serial_fd, &t_options) < 0) { if (tcgetattr(serial_fd, &t_options) < 0) {
fprintf(stderr, "Failed to get termios attrs.\n"); fprintf(stderr, "Failed to get termios attrs.\n");
} }