projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Add config and pyro tabs to graph widget
[fw/altos]
/
src
/
product
/
ao_micropeak.c
diff --git
a/src/product/ao_micropeak.c
b/src/product/ao_micropeak.c
index 54522d869aa1a8e8f895b73b46fae1b518a80b09..22559aaff085d0df5405f7e9c445d701b4a5055d 100644
(file)
--- a/
src/product/ao_micropeak.c
+++ b/
src/product/ao_micropeak.c
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-21,7
+22,6
@@
#include <ao_log_micro.h>
#include <ao_async.h>
#include <ao_log_micro.h>
#include <ao_async.h>
-static struct ao_ms5607_sample sample;
static struct ao_ms5607_value value;
alt_t ground_alt, max_alt;
static struct ao_ms5607_value value;
alt_t ground_alt, max_alt;
@@
-30,16
+30,16
@@
alt_t ao_max_height;
void
ao_pa_get(void)
{
void
ao_pa_get(void)
{
- ao_ms5607_sample(&
sample
);
- ao_ms5607_convert(&
sample
, &value);
- pa = value.pres;
+ ao_ms5607_sample(&
ao_ms5607_current
);
+ ao_ms5607_convert(&
ao_ms5607_current
, &value);
+ pa =
(uint32_t)
value.pres;
}
static void
ao_compute_height(void)
{
}
static void
ao_compute_height(void)
{
- ground_alt = ao_pa_to_altitude(pa_ground);
- max_alt = ao_pa_to_altitude(pa_min);
+ ground_alt = ao_pa_to_altitude(
(pres_t)
pa_ground);
+ max_alt = ao_pa_to_altitude(
(pres_t)
pa_min);
ao_max_height = max_alt - ground_alt;
}
ao_max_height = max_alt - ground_alt;
}
@@
-57,7
+57,7
@@
ao_pips(void)
int
main(void)
{
int
main(void)
{
- ao_led_init(
LEDS_AVAILABLE
);
+ ao_led_init();
ao_timer_init();
/* Init external hardware */
ao_timer_init();
/* Init external hardware */
@@
-73,7
+73,7
@@
main(void)
ao_report_altitude();
ao_pips();
ao_log_micro_dump();
ao_report_altitude();
ao_pips();
ao_log_micro_dump();
-#if
BOOST_DELAY
+#if
def BOOST_DELAY
ao_delay(BOOST_DELAY);
#endif
ao_delay(BOOST_DELAY);
#endif
@@
-84,7
+84,8
@@
main(void)
ao_report_altitude();
for (;;) {
cli();
ao_report_altitude();
for (;;) {
cli();
- set_sleep_mode(SLEEP_MODE_PWR_DOWN);
+#pragma GCC diagnostic ignored "-Wconversion"
+ set_sleep_mode((uint8_t) SLEEP_MODE_PWR_DOWN);
sleep_mode();
}
}
sleep_mode();
}
}