Skip to content

SerialUpload: skip first sleep on MacOS Catalina #9303

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

Closed
wants to merge 1 commit into from
Closed
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 @@ -35,11 +35,13 @@
package cc.arduino.packages.uploaders;

import cc.arduino.LoadVIDPIDSpecificPreferences;
import cc.arduino.contributions.VersionComparator;
import cc.arduino.packages.Uploader;
import processing.app.*;
import cc.arduino.packages.BoardPort;
import processing.app.debug.RunnerException;
import processing.app.debug.TargetPlatform;
import processing.app.helpers.OSUtils;
import processing.app.helpers.PreferencesMap;
import processing.app.helpers.PreferencesMapException;
import processing.app.helpers.StringReplacer;
Expand Down Expand Up @@ -135,7 +137,11 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
I18n.format(tr("Forcing reset using 1200bps open/close on port {0}"), userSelectedUploadPort));
Serial.touchForCDCReset(userSelectedUploadPort);
}
Thread.sleep(400);
// It looks like MacOS Catalina (10.15) is too fast enumerating the bootloader port
// Let's skip the initial sleep to get a faster response and eventually an enumeration
if (!(OSUtils.isMacOS() && VersionComparator.greaterThanOrEqual(OSUtils.version(), "10.15"))) {
Thread.sleep(400);
}
if (waitForUploadPort) {
// Scanning for available ports seems to open the port or
// otherwise assert DTR, which would cancel the WDT reset if
Expand Down