summaryrefslogtreecommitdiff
path: root/altoslib/AltosUnknownProduct.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-02 16:13:53 -0700
committerKeith Packard <keithp@keithp.com>2016-05-02 16:18:54 -0700
commit0b0b359cbce6b818257b44b2a6aee0edcbaee40d (patch)
tree38840d0a2addfdaa00bbd46a8980f6e31066afe0 /altoslib/AltosUnknownProduct.java
parent1a797f5fd5d25ba635fd79ad7604763253caabf2 (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/AltosUnknownProduct.java')
-rw-r--r--altoslib/AltosUnknownProduct.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/altoslib/AltosUnknownProduct.java b/altoslib/AltosUnknownProduct.java
new file mode 100644
index 00000000..ff536f57
--- /dev/null
+++ b/altoslib/AltosUnknownProduct.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright © 2010 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_10;
+
+public class AltosUnknownProduct extends Exception {
+ public String product;
+
+ public AltosUnknownProduct (String in_product) {
+ product = in_product;
+ }
+}