Skip to content

Commit 2e5e001

Browse files
committed
Undid port close+reopen change in commit 4a7f75e since it didn't solve the CrOS v67+ download failure problem.
1 parent e9d9708 commit 2e5e001

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

loader.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,10 @@ function loadPropeller(sock, portPath, action, payload, debug) {
140140
//Set postResetDelay based on platform; ideal Post-Reset Delay = 100 ms; adjust downward according to typically-busy operating systems
141141
postResetDelay = ((platform === pfWin) && (!experimentalTiming)) ? 60 : 100;
142142
if (port.connId) {
143-
// Connection exists, prep to close it first (to reset it), then open it (fresh)
144-
originalBaudrate = initialBaudrate;
145-
connect = function() {return closePort(port).then(function() {return openPort(sock, portPath, initialBaudrate, "programming")}).catch(function(e) {return Promise.reject(e)})}
146-
// The following temporarily removed (and replaced above) to intentionally close and reopen port in hopes it eliminates the CrOS v67+ failed download problem
147-
// // Connection exists, prep to reuse it
148-
// originalBaudrate = port.baud;
149-
// updatePort(port, {mode: "programming", bSocket: sock});
150-
// connect = function() {return changeBaudrate(port, initialBaudrate)}
143+
// Connection exists, prep to reuse it
144+
originalBaudrate = port.baud;
145+
updatePort(port, {mode: "programming", bSocket: sock});
146+
connect = function() {return changeBaudrate(port, initialBaudrate)}
151147
} else {
152148
// No connection yet, prep to create one
153149
originalBaudrate = initialBaudrate;

serial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function closePort(port, command) {
140140
log("Closed port " + port.path + " (id " + port.connId + ")", mDbug);
141141
// Clear connection id to indicate port is closed
142142
updatePort(port, {connId: null});
143-
setTimeout(resolve, 250); //Delay resolve() to prevent future openPort() calls from arriving too soon to accommodate
143+
resolve();
144144
} else {
145145
log("Could not close port " + port.path + " (id " + port.connId + ")", mDbug);
146146
reject(Error(notice(neCanNotClosePort, [port.path])));

0 commit comments

Comments
 (0)