From 17488b5c6b9651b6c58675620036a0b130681b20 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Mon, 10 Jul 2017 13:05:29 +0100 Subject: [PATCH] Bugfixes --- libs/core/input.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/input.ts b/libs/core/input.ts index 0045beaf..f09a508e 100644 --- a/libs/core/input.ts +++ b/libs/core/input.ts @@ -144,11 +144,11 @@ namespace input.internal { control.dmesg(`sensor set port ${port} on devtype=${this._deviceType()}`) for (let i = 0; i < sensors.length; ++i) { if (i != this.port && sensors[i].sensor == this) { - sensors[i] = null + sensors[i].sensor = null sensors[i].manual = false } } - if (this.port > 0) { + if (this.port >= 0) { let prev = sensors[this.port].sensor if (prev && prev != this) prev._setPort(0) @@ -209,7 +209,7 @@ namespace input.internal { protected _portUpdated() { this.realmode = -1 - if (this.port > 0) { + if (this.port >= 0) { if (this.isManual()) { uartReset(this.port) } else {