Skip to content

Commit 0553a89

Browse files
committed
fix corrupted eval when UART is used
1 parent 6c21336 commit 0553a89

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/comms.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,18 @@ ${Const.CONNECTION_DEVICE}.print("\\xFF");
541541
Puck lib we just copy in the default handler here. */
542542
if (callback===undefined) {
543543
connection.on("data", function(d) { // the default handler
544-
connection.received += d;
545-
connection.hadData = true;
544+
if (!Puck.RECEIVED_NOT_IN_DATA_HANDLER) {
545+
connection.received += d;
546+
connection.hadData = true;
547+
}
546548
if (connection.cb) connection.cb(d);
547549
});
548550
} else {
549551
connection.on("data", function(d) {
550-
connection.received += d;
551-
connection.hadData = true;
552+
if (!Puck.RECEIVED_NOT_IN_DATA_HANDLER) {
553+
connection.received += d;
554+
connection.hadData = true;
555+
}
552556
if (connection.cb) connection.cb(d);
553557
callback(d);
554558
});

0 commit comments

Comments
 (0)