projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stm32f1: make spi speed per-bus
[fw/altos]
/
src
/
kernel
/
ao_report.c
diff --git
a/src/kernel/ao_report.c
b/src/kernel/ao_report.c
index 4624403a10d61e0a255caf38f56fecdc8bcff4af..3795eeb34df54ed02bb96e52fb313b8fe0fcc01a 100644
(file)
--- a/
src/kernel/ao_report.c
+++ b/
src/kernel/ao_report.c
@@
-149,7
+149,7
@@
ao_report_digit(uint8_t digit)
}
static void
}
static void
-ao_report_number(
ao_v
_t n)
+ao_report_number(
int32
_t n)
{
uint8_t digits[10];
uint8_t ndigits, i;
{
uint8_t digits[10];
uint8_t ndigits, i;
@@
-168,11
+168,20
@@
ao_report_number(ao_v_t n)
while (i != 0);
}
while (i != 0);
}
+#ifdef HAS_BARO
static void
ao_report_altitude(void)
{
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);
}
}
+#endif
#if HAS_BATTERY_REPORT
static void
#if HAS_BATTERY_REPORT
static void
@@
-269,7
+278,9
@@
ao_report(void)
#endif
if (ao_report_state == ao_flight_landed) {
#endif
if (ao_report_state == ao_flight_landed) {
+#if HAS_BARO
ao_report_altitude();
ao_report_altitude();
+#endif
#if HAS_FLIGHT
ao_delay(AO_SEC_TO_TICKS(5));
continue;
#if HAS_FLIGHT
ao_delay(AO_SEC_TO_TICKS(5));
continue;