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 loadType = LOAD_TYPE_RUN;
int loadTypeOptionSeen = FALSE;
int allowExitSequence = FALSE;
int actionSpecified = FALSE;
char *file = NULL;
long imageSize;
@ -138,6 +139,9 @@ int main(int argc, char *argv[])
ShowPorts(&state, PORT_PREFIX);
actionSpecified = TRUE;
break;
case 'q':
allowExitSequence = TRUE;
break;
case 'r':
if (!loadTypeOptionSeen) {
loadTypeOptionSeen = TRUE;
@ -236,7 +240,7 @@ int main(int argc, char *argv[])
fflush(stdout);
if (baudRate2 != baudRate)
serial_baud(baudRate2);
terminal_mode(FALSE, pstMode);
terminal_mode(allowExitSequence, pstMode);
}
return 0;
@ -253,6 +257,7 @@ usage: p1load\n\
[ -e ] write a bootable image to EEPROM\n\
[ -p port ] serial port (default is to auto-detect the port)\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\
[ -t ] enter terminal mode after running the program\n\
[ -T ] enter PST-compatible terminal mode\n\