From 538d6373faa495715631f51b58975db129c5a900 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jun 2024 22:10:33 +0200 Subject: [PATCH] v1.0.377 --- CHANGELOG.txt | 4 +++- index.js | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8aac25c..9f09db9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,9 @@ v1.0.377: - Fixed Grbl Settings Description for $14, $486 - Fixed USB descriptor for Pico - Removed remaining Smoothieware leftovers -- Re-Enabled DTR toggle for native USB support +- Fixed issue #360: Clear queue on port.disconnect +- Fixed issue #359 +- Fixed issue #330: Re-Enabled DTR toggle for native USB support v1.0.376: - Updated installer End User License Agreement diff --git a/index.js b/index.js index 1734e25..380df6a 100644 --- a/index.js +++ b/index.js @@ -2354,9 +2354,14 @@ function stopPort() { // port.drain(port.close()); if (status.comms.interfaces.type == "usb") { - port.drain(port.close()); + if (port.isOpen) { + port.drain(port.close()); + } } else if (status.comms.interfaces.type == "telnet") { - port.destroy(); + if (port.isOpen) { + port.destroy(); + port.isOpen = false; + } } }