Add option to beep max height in feet rather than just meters
[fw/altos] / src / kernel / ao_report.c
index 4624403a10d61e0a255caf38f56fecdc8bcff4af..977cea854ff1f014e0927a25530b34988e2682a8 100644 (file)
@@ -149,7 +149,7 @@ ao_report_digit(uint8_t digit)
 }
 
 static void
-ao_report_number(ao_v_t n)
+ao_report_number(int32_t n)
 {
        uint8_t digits[10];
        uint8_t ndigits, i;
@@ -171,7 +171,14 @@ ao_report_number(ao_v_t n)
 static void
 ao_report_altitude(void)
 {
-       ao_report_number(ao_max_height);
+       alt_t max_h = ao_max_height;
+       if (ao_config.report_feet) {
+               max_h = max_h * 39 / 12;
+               /* report a leading zero to distinguish */
+               if (max_h)
+                       ao_report_digit(0);
+       }
+       ao_report_number(max_h);
 }
 
 #if HAS_BATTERY_REPORT