p1load.c added "-q" method to exit

This commit is contained in:
github 2018-10-13 08:11:52 +00:00
parent 1028b3bade
commit f68112ae99
1 changed files with 6 additions and 1 deletions

View File

@ -45,6 +45,7 @@ int main(int argc, char *argv[])
int baudRate, baudRate2, verbose, terminalMode, pstMode, i; int baudRate, baudRate2, verbose, terminalMode, pstMode, i;
int loadType = LOAD_TYPE_RUN; int loadType = LOAD_TYPE_RUN;
int loadTypeOptionSeen = FALSE; int loadTypeOptionSeen = FALSE;
int allowExitSequence = FALSE;
int actionSpecified = FALSE; int actionSpecified = FALSE;
char *file = NULL; char *file = NULL;
long imageSize; long imageSize;
@ -138,6 +139,9 @@ int main(int argc, char *argv[])
ShowPorts(&state, PORT_PREFIX); ShowPorts(&state, PORT_PREFIX);
actionSpecified = TRUE; actionSpecified = TRUE;
break; break;
case 'q':
allowExitSequence = TRUE;
break;
case 'r': case 'r':
if (!loadTypeOptionSeen) { if (!loadTypeOptionSeen) {
loadTypeOptionSeen = TRUE; loadTypeOptionSeen = TRUE;
@ -236,7 +240,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
if (baudRate2 != baudRate) if (baudRate2 != baudRate)
serial_baud(baudRate2); serial_baud(baudRate2);
terminal_mode(FALSE, pstMode); terminal_mode(allowExitSequence, pstMode);
} }
return 0; return 0;
@ -253,6 +257,7 @@ usage: p1load\n\
[ -e ] write a bootable image to EEPROM\n\ [ -e ] write a bootable image to EEPROM\n\
[ -p port ] serial port (default is to auto-detect the port)\n\ [ -p port ] serial port (default is to auto-detect the port)\n\
[ -P ] list available serial ports\n\ [ -P ] list available serial ports\n\
[ -q ] quit on the exit sequence (0xff, 0x00, status)\n\
[ -r ] run the program after loading (default)\n\ [ -r ] run the program after loading (default)\n\
[ -t ] enter terminal mode after running the program\n\ [ -t ] enter terminal mode after running the program\n\
[ -T ] enter PST-compatible terminal mode\n\ [ -T ] enter PST-compatible terminal mode\n\