altoslib: Fix MS5607 raw data to pressure conversion function
[fw/altos] / altoslib / AltosMs5607.java
index 4f5549a74d297c93017bed1ec67d0490c3a476c9..19d2dd6db0b94fc6b85a9e6e9c5c15d4dbeea602 100644 (file)
@@ -3,7 +3,8 @@
  *
  * 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.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +21,7 @@ package org.altusmetrum.altoslib_11;
 import java.util.concurrent.*;
 import java.io.*;
 
-public class AltosMs5607 implements Serializable {
+public class AltosMs5607 {
        public int      reserved;
        public int      sens;
        public int      off;
@@ -63,7 +64,7 @@ public class AltosMs5607 implements Serializable {
                        int TEMPM = TEMP - 2000;
                        long OFF2 = ((long) 61 * (long) TEMPM * (long) TEMPM) >> 4;
                        long SENS2 = (long) 2 * (long) TEMPM * (long) TEMPM;
-                       if (TEMP < 1500) {
+                       if (TEMP < -1500) {
                                int TEMPP = TEMP + 1500;
                                long TEMPP2 = (long) TEMPP * (long) TEMPP;
                                OFF2 = OFF2 + 15 * TEMPP2;