From 096a17aa386ff882a9712b9d4a3147b69a553e32 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Tue, 20 Feb 2024 21:52:16 -0800 Subject: [PATCH] Workaround for GH Issue 293 --- Source/GnssTracker/GnssTrackerHardwareV2.cs | 3 ++ Source/GnssTracker_Demo/MeadowApp.cs | 40 ++++++++++----------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Source/GnssTracker/GnssTrackerHardwareV2.cs b/Source/GnssTracker/GnssTrackerHardwareV2.cs index 30e209e..dc1faa9 100644 --- a/Source/GnssTracker/GnssTrackerHardwareV2.cs +++ b/Source/GnssTracker/GnssTrackerHardwareV2.cs @@ -58,6 +58,9 @@ public GnssTrackerHardwareV2(IF7CoreComputeMeadowDevice device, II2cBus i2cBus) base.device = device; I2cBus = i2cBus; + + // TODO: Workaround for https://github.com/WildernessLabs/Meadow_Issues/issues/293 + InitializeOnboardRgbLed(); } private IRgbPwmLed? GetOnboardRgbLed() diff --git a/Source/GnssTracker_Demo/MeadowApp.cs b/Source/GnssTracker_Demo/MeadowApp.cs index a24c9c8..c7ad21a 100644 --- a/Source/GnssTracker_Demo/MeadowApp.cs +++ b/Source/GnssTracker_Demo/MeadowApp.cs @@ -64,9 +64,9 @@ public override Task Initialize() accelerometer.Updated += AccelerometerUpdated; ; } - if (gnssTracker.BatteryVoltageInput is { } batteryVoltage) + if (gnssTracker.BatteryVoltageInput is { } batteryvoltage) { - batteryVoltage.Updated += BatteryVoltageUpdated; + batteryvoltage.Updated += BatteryVoltageUpdated; } if (gnssTracker.SolarVoltageInput is { } solarVoltage) @@ -95,24 +95,6 @@ public override Task Initialize() return Task.CompletedTask; } - private void GnssRmcReceived(object sender, GnssPositionInfo e) - { - if (e.Valid) - { - ReportGNSSPosition(e); - lastGNSSPosition = e; - } - } - - private void GnssGllReceived(object sender, GnssPositionInfo e) - { - if (e.Valid) - { - ReportGNSSPosition(e); - lastGNSSPosition = e; - } - } - private void TemperatureSensorUpdated(object sender, IChangeResult e) { Resolver.Log.Info($"TEMPERATURE: {e.New.Celsius:N1}C"); @@ -160,6 +142,24 @@ private void SolarVoltageUpdated(object sender, IChangeResult e) solarVoltage = e.New; } + private void GnssRmcReceived(object sender, GnssPositionInfo e) + { + if (e.Valid) + { + ReportGNSSPosition(e); + lastGNSSPosition = e; + } + } + + private void GnssGllReceived(object sender, GnssPositionInfo e) + { + if (e.Valid) + { + ReportGNSSPosition(e); + lastGNSSPosition = e; + } + } + private void ReportGNSSPosition(GnssPositionInfo e) { if (e.Valid)