Skip to content

Commit

Permalink
Fix a problem with getting serial device names under Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Betz committed Apr 19, 2017
1 parent 3304189 commit d4d2894
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/enumcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int SerialFind(const char* prefix, int (*check)(const char* port, void* data), v
//printf("Device path: %s\n", pDetData->DevicePath);
//printf("Friendly name: %s\n", fname);
//printf("Description: %s\n", desc);
if ((comx = strchr(fname, '(')) != NULL)
if ((comx = strrchr(fname, '(')) != NULL)
++comx;
else
comx = fname;
Expand Down
14 changes: 7 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ int main(int argc, char *argv[])
configSettings = NewBoardConfig(NULL, "");

/* get the arguments */
for(i = 1; i < argc; ++i) {
for (i = 1; i < argc; ++i) {

/* handle switches */
if(argv[i][0] == '-') {
switch(argv[i][1]) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'b': // select a target board
if (argv[i][2])
board = &argv[i][2];
Expand All @@ -132,9 +132,9 @@ int main(int argc, char *argv[])
showMessageCodes = true;
break;
case 'D':
if(argv[i][2])
if (argv[i][2])
p = &argv[i][2];
else if(++i < argc)
else if (++i < argc)
p = argv[i];
else
usage(argv[0]);
Expand Down Expand Up @@ -174,9 +174,9 @@ int main(int argc, char *argv[])
useSerial = false;
break;
case 'I': // add a directory to the .cfg include path
if(argv[i][2])
if (argv[i][2])
p = &argv[i][2];
else if(++i < argc)
else if (++i < argc)
p = argv[i];
else
usage(argv[0]);
Expand Down
1 change: 1 addition & 0 deletions src/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ enum {
/* 121 */ ERROR_INSUFFICIENT_MEMORY,
/* 122 */ ERROR_NO_RESET_METHOD,
/* 123 */ ERROR_RESET_FAILED,
/* 124 */ ERROR_WRONG_PROPELLER_VERSION,
MAX_ERROR
};

Expand Down

0 comments on commit d4d2894

Please sign in to comment.