Minor reordering of serial port setup.
This commit is contained in:
parent
b3512b52de
commit
df1907fbea
@ -179,16 +179,18 @@ int serial_init(const char* port, unsigned long baud)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fcntl(hSerial, F_SETFL, 0);
|
||||||
|
|
||||||
/* get the current options */
|
/* get the current options */
|
||||||
chk("tcgetattr", tcgetattr(hSerial, &old_sparm));
|
chk("tcgetattr", tcgetattr(hSerial, &old_sparm));
|
||||||
sparm = old_sparm;
|
sparm = old_sparm;
|
||||||
|
|
||||||
/* set raw input */
|
/* set raw input */
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
cfmakeraw(&sparm);
|
cfmakeraw(&sparm);
|
||||||
sparm.c_cc[VTIME] = 0;
|
sparm.c_cc[VTIME] = 0;
|
||||||
sparm.c_cc[VMIN] = 1;
|
sparm.c_cc[VMIN] = 1;
|
||||||
chk("cfsetspeed", cfsetspeed(&sparm, tbaud));
|
chk("cfsetspeed", cfsetspeed(&sparm, tbaud));
|
||||||
#else
|
#else
|
||||||
memset(&sparm, 0, sizeof(sparm));
|
memset(&sparm, 0, sizeof(sparm));
|
||||||
sparm.c_cflag = CS8 | CLOCAL | CREAD;
|
sparm.c_cflag = CS8 | CLOCAL | CREAD;
|
||||||
|
7
p1load.c
7
p1load.c
@ -229,6 +229,13 @@ usage: p1load\n\
|
|||||||
[ -v ] verbose output\n\
|
[ -v ] verbose output\n\
|
||||||
[ -? ] display a usage message and exit\n\
|
[ -? ] display a usage message and exit\n\
|
||||||
file file to load\n", BAUD_RATE);
|
file file to load\n", BAUD_RATE);
|
||||||
|
#ifdef RASPBERRY_PI
|
||||||
|
printf("\
|
||||||
|
\n\
|
||||||
|
This version supports resetting the Propeller with a GPIO pin with option: -Dreset=gpio,pin,level\n\
|
||||||
|
where \"pin\" is the GPIO number to use and \"level\" is the logic level, 0 or 1. \n\
|
||||||
|
");
|
||||||
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user