FreeCalypso > hg > freecalypso-sw
comparison rvinterf/lowlevel/tfc139.c @ 432:15e69d31c96f
tfc139: allow -B option just like rvtdump and rvinterf
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 21 Jun 2014 23:50:25 +0000 |
parents | 3a46728e054b |
children | 0d7cc054ef72 |
comparison
equal
deleted
inserted
replaced
431:5c75d84ffa81 | 432:15e69d31c96f |
---|---|
83 extern char *optarg; | 83 extern char *optarg; |
84 extern int optind; | 84 extern int optind; |
85 int c; | 85 int c; |
86 fd_set fds; | 86 fd_set fds; |
87 | 87 |
88 while ((c = getopt(argc, argv, "a:l:s:w:")) != EOF) | 88 baudrate_name = "57600"; /* what C139 firmware uses */ |
89 while ((c = getopt(argc, argv, "a:B:l:s:w:")) != EOF) | |
89 switch (c) { | 90 switch (c) { |
90 case 'a': | 91 case 'a': |
91 iram_load_addr = strtoul(optarg, 0, 16); | 92 iram_load_addr = strtoul(optarg, 0, 16); |
93 continue; | |
94 case 'B': | |
95 baudrate_name = optarg; | |
92 continue; | 96 continue; |
93 case 'l': | 97 case 'l': |
94 logfname = optarg; | 98 logfname = optarg; |
95 continue; | 99 continue; |
96 case 's': | 100 case 's': |
105 "usage: %s [options] ttyport\n", argv[0]); | 109 "usage: %s [options] ttyport\n", argv[0]); |
106 exit(1); | 110 exit(1); |
107 } | 111 } |
108 if (argc - optind != 1) | 112 if (argc - optind != 1) |
109 goto usage; | 113 goto usage; |
110 baudrate_name = "57600"; /* what Compal phones use */ | |
111 open_target_serial(argv[optind]); | 114 open_target_serial(argv[optind]); |
112 target_tty_port = argv[optind]; | 115 target_tty_port = argv[optind]; |
113 | 116 |
114 set_serial_nonblock(0); | 117 set_serial_nonblock(0); |
115 setlinebuf(stdout); | 118 setlinebuf(stdout); |