diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-02 16:13:53 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-05-02 16:18:54 -0700 |
commit | 0b0b359cbce6b818257b44b2a6aee0edcbaee40d (patch) | |
tree | 38840d0a2addfdaa00bbd46a8980f6e31066afe0 /altoslib/AltosConfigData.java | |
parent | 1a797f5fd5d25ba635fd79ad7604763253caabf2 (diff) |
altoslib: Deal with TeleMetrum v2.0 MMA6555 being inverted
Dumping the MMA655X data with the 'A' command provides the raw sensor
value. On TM v2.0 boards, the sensor is inverted, and all of the
firmware uses the inverted value except for the 'dump the raw data'
command. As a result, MonitorIdle was using the un-inverted value and
displaying mystic values.
I've fixed this in the ground station code by checking the product
name and conditionally inverting the value (4095 - value) for
TeleMetrum v2.0 products. Unknown products will generate a warning
dialog on AltosUI so we'll catch places where we've failed to add a
new product name.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConfigData.java')
-rw-r--r-- | altoslib/AltosConfigData.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 7affbdec..812296f3 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -476,6 +476,18 @@ public class AltosConfigData implements Iterable<String> { } + public boolean mma655x_inverted() throws AltosUnknownProduct { + if (product.startsWith("EasyMega-v1")) + return false; + if (product.startsWith("TeleMetrum-v2")) + return true; + if (product.startsWith("TeleMega-v2")) + return false; + if (product.startsWith("TeleMega-v1")) + return false; + throw new AltosUnknownProduct(product); + } + public void get_values(AltosConfigValues source) throws AltosConfigDataException { /* HAS_FLIGHT */ |