From aad9f0fd8aefe44d78f9b9974534d5e2170a6cff Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 18 Oct 2019 22:03:50 -0700 Subject: [PATCH] more tinkering --- libs/core/input.ts | 2 +- libs/core/output.ts | 2 +- libs/ev3/startup.ts | 1 + libs/screen/targetoverrides.ts | 10 +++------- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/libs/core/input.ts b/libs/core/input.ts index 41bdd7a9..1cb2e035 100644 --- a/libs/core/input.ts +++ b/libs/core/input.ts @@ -106,7 +106,7 @@ namespace sensors.internal { } } - function init() { + export function init() { if (sensorInfos) return sensorInfos = [] for (let i = 0; i < DAL.NUM_INPUTS; ++i) sensorInfos.push(new SensorInfo(i)) diff --git a/libs/core/output.ts b/libs/core/output.ts index 46760a3a..b8c7b011 100644 --- a/libs/core/output.ts +++ b/libs/core/output.ts @@ -55,7 +55,7 @@ namespace motors { Size = 12 } - function init() { + export function init() { if (pwmMM) return pwmMM = control.mmap("/dev/lms_pwm", 0, 0) if (!pwmMM) control.fail("no PWM file") diff --git a/libs/ev3/startup.ts b/libs/ev3/startup.ts index fde5127f..42242d63 100644 --- a/libs/ev3/startup.ts +++ b/libs/ev3/startup.ts @@ -2,5 +2,6 @@ console.addListener(function(priority: ConsolePriority, msg: string) { control.dmesg(msg.substr(0, msg.length - 1)) }) + // boot sequence brick.showBoot(); \ No newline at end of file diff --git a/libs/screen/targetoverrides.ts b/libs/screen/targetoverrides.ts index 8ab0aac1..e907255d 100644 --- a/libs/screen/targetoverrides.ts +++ b/libs/screen/targetoverrides.ts @@ -194,15 +194,11 @@ namespace brick { // pulse green, play startup sound, turn off light brick.setStatusLight(StatusLight.GreenPulse); // We pause for 100ms to give time to read sensor values, so they work in on_start block - pause(400) + sensors.internal.init(); + motors.init(); + pause(800) // and we're ready brick.setStatusLight(StatusLight.Off); - // always show port by default if no UI is set - control.runInParallel(function () { - // show ports if nothing is has been shown - if (screenMode != ScreenMode.None) return; - showPorts(); - }) } /**