Skip to content

Commit a75eb96

Browse files
committed
Reduce
1 parent 1f934bc commit a75eb96

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/js/tabs/firmware_flasher.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,23 @@ const firmware_flasher = {
7777
detectedSerialDevice: function (device) {
7878
console.log(`${firmware_flasher.logHead} Detected serial device:`, device);
7979

80-
if (GUI.connect_lock && !STM32.rebootMode) {
80+
// If another operation is in progress, ignore port events.
81+
if (GUI.connect_lock) {
8182
console.log(
8283
`${firmware_flasher.logHead} Serial device event ignored due to active operation (connect_lock)`,
8384
);
8485
return;
8586
}
8687

88+
const isFlashOnConnect = $("input.flash_on_connect").is(":checked");
89+
90+
// If flash-on-connect is enabled, trigger startFlashing (if available) instead
91+
// of running AutoDetect.verifyBoard(), mirroring the onPortChange logic.
92+
if (isFlashOnConnect) {
93+
firmware_flasher.startFlashing?.();
94+
return;
95+
}
96+
8797
try {
8898
AutoDetect.verifyBoard();
8999
} catch (e) {

0 commit comments

Comments
 (0)