diff options
Diffstat (limited to 'ao_convert.c')
-rw-r--r-- | ao_convert.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ao_convert.c b/ao_convert.c index 2585db54..57ed7370 100644 --- a/ao_convert.c +++ b/ao_convert.c @@ -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; -} |