summaryrefslogtreecommitdiff
path: root/src/micropeak
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-09 18:27:49 -0800
committerKeith Packard <keithp@keithp.com>2012-12-09 18:27:49 -0800
commitdefd5d0784a754be30e3295067fbc85a108ad172 (patch)
tree891a08c4ea8f0eaad39b46cae64fb2a0f212c14f /src/micropeak
parent24948ea1d41f2a7c96ac09e35d1250909e5726ae (diff)
altos: Make sure pa to altitude conversion is done with 32 bits
We need 32 bits to hold intermediate values, even if the final altitude is reported in only 16 bits. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/micropeak')
-rw-r--r--src/micropeak/ao_pins.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/micropeak/ao_pins.h b/src/micropeak/ao_pins.h
index 187b2544..63e9cb1b 100644
--- a/src/micropeak/ao_pins.h
+++ b/src/micropeak/ao_pins.h
@@ -60,6 +60,6 @@
typedef int32_t alt_t;
#define FETCH_ALT(o) ((alt_t) pgm_read_dword(&altitude_table[o]))
-#define AO_ALT_VALUE(x) ((x) * 10)
+#define AO_ALT_VALUE(x) ((x) * (alt_t) 10)
#endif /* _AO_PINS_H_ */