Skip to content

Fix for 'Uploading to Arduino Yun gives a 'programmer is not respondi… #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static String wait_for_com_Port_to_appear(MessageConsoleStream console, V
int NumTries = 0;
int MaxTries = 40; // wait for max 10 seconds as arduino does
int delayMs = 250;
int PrefNewPortsCopySize=-10;
do {

NewPorts = Serial.list();
Expand All @@ -90,6 +91,14 @@ public static String wait_for_com_Port_to_appear(MessageConsoleStream console, V
console.println("}");
/* end of dump to the console */

// code to capture the case: the com port reappears with a name that was in the original list
int NewPortsCopySize = NewPorts.size();
if ((NewPortsCopy.size() == 0) && (NewPortsCopySize == PrefNewPortsCopySize + 1)) {
console.println("Comport appeared and disappeared with same name");
return defaultComPort;
}
PrefNewPortsCopySize = NewPortsCopySize;

if (NumTries++ > MaxTries) {
console.println("Comport is not behaving as expected");
return defaultComPort;
Expand Down