From 1453b7e0a3d90b1c6c4367d0f2f25a443c7301d8 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 11 Jan 2018 11:17:23 -0800 Subject: [PATCH] gyro reset fix --- libs/core/input.ts | 2 +- libs/gyro-sensor/gyro.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/input.ts b/libs/core/input.ts index eb011e59..4d7b6185 100644 --- a/libs/core/input.ts +++ b/libs/core/input.ts @@ -310,7 +310,7 @@ namespace sensors.internal { return getUartNumber(fmt, off, this._port) } - protected reset() { + reset() { if (this.isActive()) uartReset(this._port); } } diff --git a/libs/gyro-sensor/gyro.ts b/libs/gyro-sensor/gyro.ts index 11e46e26..791ef732 100644 --- a/libs/gyro-sensor/gyro.ts +++ b/libs/gyro-sensor/gyro.ts @@ -79,7 +79,7 @@ namespace sensors { // may be triggered by a button click, give time to settle loops.pause(500); // send a reset command - this.reset(); + super.reset(); // we need to switch mode twice to perform a calibration if (this.mode == GyroSensorMode.Rate) this.setMode(GyroSensorMode.Angle);