From 641d292c33522dc78e144524f70e2f7695836158 Mon Sep 17 00:00:00 2001 From: Caitlin Hennessy Date: Wed, 13 Dec 2017 14:55:14 -0800 Subject: [PATCH] Clean commit for motor fix --- libs/core/output.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/core/output.ts b/libs/core/output.ts index 7f982cb8..c5e42ef3 100644 --- a/libs/core/output.ts +++ b/libs/core/output.ts @@ -34,6 +34,7 @@ namespace motors { pwmMM = control.mmap("/dev/lms_pwm", 0, 0) if (!pwmMM) control.fail("no PWM file") motorMM = control.mmap("/dev/lms_motor", MotorDataOff.Size * DAL.NUM_OUTPUTS, 0) + if (!motorMM) control.fail("no motor file") resetMotors() @@ -262,6 +263,7 @@ namespace motors { // only a single output at a time function getMotorData(out: Output): MotorData { + init() let buf = motorMM.slice(outOffset(out), MotorDataOff.Size) return { actualSpeed: buf.getNumber(NumberFormat.Int8LE, MotorDataOff.Speed),