FreeCalypso > hg > freecalypso-tools
diff loadtools/compalload.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 | b77005f6d315 |
children |
line wrap: on
line diff
--- a/loadtools/compalload.c Thu Sep 21 21:49:07 2017 +0000 +++ b/loadtools/compalload.c Thu Sep 21 23:07:01 2017 +0000 @@ -13,13 +13,11 @@ #include <stdlib.h> #include <string.h> #include <strings.h> -#include <termios.h> #include <unistd.h> extern char default_compalstage_dir[]; extern char *target_ttydev; extern int target_fd; -extern struct termios target_termios; static char compalstage_pathname[MAXPATHLEN]; static u_char *compalstage_imgbuf; @@ -153,7 +151,7 @@ } } -perform_compal_stage(for_boot_rom) +perform_compal_stage() { int fd; struct stat st; @@ -197,26 +195,12 @@ compute_checksum(); printf("Using Compal stage image %s\n", compalstage_pathname); - cfsetispeed(&target_termios, B115200); - cfsetospeed(&target_termios, B115200); - if (tcsetattr(target_fd, TCSAFLUSH, &target_termios) < 0) { - perror("tcsetattr to switch baud rate"); - exit(1); - } + set_fixed_baudrate("115200"); ioctl(target_fd, FIONBIO, &zero); printf("Waiting for PROMPT1 from target (%s) at 115200 baud\n", target_ttydev); read_loop(); free(compalstage_imgbuf); - if (for_boot_rom) { - cfsetispeed(&target_termios, B19200); - cfsetospeed(&target_termios, B19200); - if (tcsetattr(target_fd, TCSAFLUSH, &target_termios) < 0) { - perror("tcsetattr to switch baud rate"); - exit(1); - } - } - return(1); }