Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 291d324

Browse files
rogerclarkmelbournefpistm
authored andcommitted
Fix issue on OSX (and other platforms)
where stm32flash only works if the serial device name starts with /dev/tty, as on OSX some serial devices start with /dev/cu. Also corrected mistake about .a file in stm32 parsers folder, and hopefully removed the .a file from source control Signed-off-by: Roger Clark <[email protected]>
1 parent 66dafe7 commit 291d324

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

serial_posix.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,34 @@ static port_err_t serial_setup(serial_t *h, const serial_baud_t baud,
198198
return PORT_ERR_OK;
199199
}
200200

201+
/*
202+
* Roger clark.
203+
* This function is no longer used. But has just been commented out in case it needs
204+
* to be reinstated in the future
205+
201206
static int startswith(const char *haystack, const char *needle) {
202207
return strncmp(haystack, needle, strlen(needle)) == 0;
203208
}
209+
*/
204210

205211
static int is_tty(const char *path) {
206212
char resolved[PATH_MAX];
207213

208214
if(!realpath(path, resolved)) return 0;
209215

216+
217+
/*
218+
* Roger Clark
219+
* Commented out this check, because on OSX some devices are /dev/cu
220+
* and some users use symbolic links to devices, hence the name may not even start
221+
* with /dev
222+
210223
if(startswith(resolved, "/dev/tty")) return 1;
211224
212225
return 0;
226+
*/
227+
228+
return 1;
213229
}
214230

215231
static port_err_t serial_posix_open(struct port_interface *port,

0 commit comments

Comments
 (0)