From df1907fbeaa4faba1635241dd0f6d9548c72d328 Mon Sep 17 00:00:00 2001 From: David Betz Date: Tue, 27 Jan 2015 18:22:38 -0500 Subject: [PATCH] Minor reordering of serial port setup. --- osint_linux.c | 10 ++++++---- p1load.c | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/osint_linux.c b/osint_linux.c index 43f1b5a..f418f7a 100644 --- a/osint_linux.c +++ b/osint_linux.c @@ -179,16 +179,18 @@ int serial_init(const char* port, unsigned long baud) return 0; } + fcntl(hSerial, F_SETFL, 0); + /* get the current options */ chk("tcgetattr", tcgetattr(hSerial, &old_sparm)); sparm = old_sparm; /* set raw input */ #ifdef MACOSX - cfmakeraw(&sparm); - sparm.c_cc[VTIME] = 0; - sparm.c_cc[VMIN] = 1; - chk("cfsetspeed", cfsetspeed(&sparm, tbaud)); + cfmakeraw(&sparm); + sparm.c_cc[VTIME] = 0; + sparm.c_cc[VMIN] = 1; + chk("cfsetspeed", cfsetspeed(&sparm, tbaud)); #else memset(&sparm, 0, sizeof(sparm)); sparm.c_cflag = CS8 | CLOCAL | CREAD; diff --git a/p1load.c b/p1load.c index 59e7da7..c0024db 100644 --- a/p1load.c +++ b/p1load.c @@ -229,6 +229,13 @@ usage: p1load\n\ [ -v ] verbose output\n\ [ -? ] display a usage message and exit\n\ 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); }