Skip to content

Commit

Permalink
Move setSlowWrite call from menuPortSelector to serial.open
Browse files Browse the repository at this point in the history
Remove useless ESP32 slow write check that didn't disable it
Disable slow write on ESP32 as there's flow control
  • Loading branch information
gfwilliams committed Sep 2, 2024
1 parent ecb16b6 commit b9c0f37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions core/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ To add a new serial device, you must add an object to
};

var openSerial=function(serialPort, connectCallback, disconnectCallback) {
Espruino.Core.Serial.setSlowWrite(true); // force slow write to ensure things work ok - we may disable this when versionChecker figures out what board/version we use
return openSerialInternal(serialPort, connectCallback, disconnectCallback, 5);
}

Expand Down
7 changes: 4 additions & 3 deletions plugins/versionChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@
(env.CONSOLE=="USB"||env.CONSOLE=="Bluetooth"||env.CONSOLE=="Telnet")) {
console.log("Firmware >1.43 supports faster writes over USB");
Espruino.Core.Serial.setSlowWrite(false);
} else if (vCurrent >= 2.18 && env.BOARD=="ESP32" && env.CONSOLE=="Serial1") {
console.log("Firmware >=2.18 on ESP32 supports flow control");
Espruino.Core.Serial.setSlowWrite(true);
} else {
// setSlowWrite(true) called in Serial.open so is the default
if ( Espruino.Core.Serial.isSlowWrite()) // not disabled already?
console.log(`Note: Uploads may be slow. Use SERIAL_THROTTLE_SEND/'Throttle Send' option to disable throttling at the expense of unreliable uploads on some boards.`);
}

if (env.info!==undefined &&
Expand Down

0 comments on commit b9c0f37

Please sign in to comment.