Decrease telemetry rate on the pad to 1/sec instead of 20/sec
[fw/altos] / ao_convert.c
index 2585db54264586818b68ca538f3525144f538587..57ed73701abefe29d99d888ddbe35b4a586b982a 100644 (file)
@@ -30,6 +30,17 @@ ao_pres_to_altitude(int16_t pres) __reentrant
        return altitude_table[pres];
 }
 
+int16_t
+ao_altitude_to_pres(int16_t alt) __reentrant
+{
+       int16_t pres;
+
+       for (pres = 0; pres < 2047; pres++)
+               if (altitude_table[pres] <= alt)
+                       break;
+       return pres << 4;
+}
+
 static __xdata uint8_t ao_temp_mutex;
 
 int16_t
@@ -42,10 +53,3 @@ ao_temp_to_dC(int16_t temp) __reentrant
        ao_mutex_put(&ao_temp_mutex);
        return ret;
 }
-
-int16_t
-ao_accel_to_cm_per_s2(int16_t accel) __reentrant
-{
-       /* this is wrong */
-       return (998 - (accel >> 4)) * 3300 / 2047;
-}