FreeCalypso > hg > freecalypso-tools
comparison loadtools/ltmain.c @ 575:cef70d53fc5e
loadtools: new -P boot control mechanism implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 02 Feb 2020 20:01:22 +0000 |
parents | aba969153d20 |
children | ecea01f65146 |
comparison
equal
deleted
inserted
replaced
574:aba969153d20 | 575:cef70d53fc5e |
---|---|
26 extern char *optarg; | 26 extern char *optarg; |
27 extern int optind; | 27 extern int optind; |
28 int c; | 28 int c; |
29 char command[512]; | 29 char command[512]; |
30 | 30 |
31 while ((c = getopt(argc, argv, "a:b:B:c:C:h:H:i:r:")) != EOF) | 31 while ((c = getopt(argc, argv, "a:b:B:c:C:h:H:i:P:r:")) != EOF) |
32 switch (c) { | 32 switch (c) { |
33 case 'a': | 33 case 'a': |
34 iramimage.filename = optarg; | 34 iramimage.filename = optarg; |
35 continue; | 35 continue; |
36 case 'b': | 36 case 'b': |
54 read_hwparam_file_fullpath(optarg); | 54 read_hwparam_file_fullpath(optarg); |
55 continue; | 55 continue; |
56 case 'i': | 56 case 'i': |
57 set_beacon_interval(optarg); | 57 set_beacon_interval(optarg); |
58 continue; | 58 continue; |
59 case 'P': | |
60 if (find_bootctrl_entry(optarg) < 0) | |
61 exit(1); /* error msg already printed */ | |
62 continue; | |
59 case 'r': | 63 case 'r': |
60 reattach = find_baudrate_by_name(optarg); | 64 reattach = find_baudrate_by_name(optarg); |
61 if (!reattach) | 65 if (!reattach) |
62 exit(1); /* error msg already printed */ | 66 exit(1); /* error msg already printed */ |
63 continue; | 67 continue; |
75 | 79 |
76 open_serial_port(target_ttydev); | 80 open_serial_port(target_ttydev); |
77 if (reattach) | 81 if (reattach) |
78 set_serial_baudrate(reattach); | 82 set_serial_baudrate(reattach); |
79 else { | 83 else { |
84 pwon_if_needed(); | |
80 perform_compal_stage(); | 85 perform_compal_stage(); |
81 perform_romload(); | 86 perform_romload(); |
82 putchar('\n'); | 87 putchar('\n'); |
83 if (tpinterf_pass_output(1) < 0) | 88 if (tpinterf_pass_output(1) < 0) |
84 exit(1); | 89 exit(1); |