altos: Use alt_t value to hold displayed height in micropeak micropeak-build-2012-12-09
authorKeith Packard <keithp@keithp.com>
Mon, 10 Dec 2012 02:28:33 +0000 (18:28 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 10 Dec 2012 02:28:33 +0000 (18:28 -0800)
Heights are 32 bits (to get .1 meter resolution) in micropeak; make
sure we have enough bits while blinking out the computed value.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/micropeak/ao_report_tiny.c

index 109af1ed05050f31f2af72bdc3d590587c1f7a1b..bdcc131eacdc2f783e2d4c880f8051088f35d5a8 100644 (file)
@@ -38,8 +38,8 @@ ao_report_digit(uint8_t digit) __reentrant
 void
 ao_report_altitude(void)
 {
-       __pdata int16_t agl = ao_max_height;
-       __xdata uint8_t digits[10];
+       __pdata alt_t   agl = ao_max_height;
+       static __xdata uint8_t  digits[11];
        __pdata uint8_t ndigits, i;
 
        if (agl < 0)