projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
micropeak: Support µPUSB with our own USB ids
[fw/altos]
/
src
/
kernel
/
ao.h
diff --git
a/src/kernel/ao.h
b/src/kernel/ao.h
index a225bc4aca9d81eac96e3f77bc04bc92f5323039..16d600aa08b46319767ebc550e72b7efcb84fdba 100644
(file)
--- a/
src/kernel/ao.h
+++ b/
src/kernel/ao.h
@@
-43,10
+43,6
@@
#define HAS_TASK 1
#endif
#define HAS_TASK 1
#endif
-#ifndef AO_PORT_TYPE
-#define AO_PORT_TYPE uint8_t
-#endif
-
typedef AO_PORT_TYPE ao_port_t;
#if HAS_TASK
typedef AO_PORT_TYPE ao_port_t;
#if HAS_TASK
@@
-278,15
+274,17
@@
ao_report_init(void);
* Given raw data, convert to SI units
*/
* Given raw data, convert to SI units
*/
+#if HAS_BARO
/* pressure from the sensor to altitude in meters */
/* pressure from the sensor to altitude in meters */
-
int16
_t
-ao_pres_to_altitude(
int16
_t pres) __reentrant;
+
alt
_t
+ao_pres_to_altitude(
pres
_t pres) __reentrant;
-
int16
_t
-ao_altitude_to_pres(
int16
_t alt) __reentrant;
+
pres
_t
+ao_altitude_to_pres(
alt
_t alt) __reentrant;
int16_t
ao_temp_to_dC(int16_t temp) __reentrant;
int16_t
ao_temp_to_dC(int16_t temp) __reentrant;
+#endif
/*
* ao_convert_pa.c
/*
* ao_convert_pa.c
@@
-296,11
+294,13
@@
ao_temp_to_dC(int16_t temp) __reentrant;
#include <ao_data.h>
#include <ao_data.h>
+#if HAS_BARO
alt_t
alt_t
-ao_pa_to_altitude(
int32
_t pa);
+ao_pa_to_altitude(
pres
_t pa);
int32_t
ao_altitude_to_pa(alt_t alt);
int32_t
ao_altitude_to_pa(alt_t alt);
+#endif
#if HAS_DBG
#include <ao_dbg.h>
#if HAS_DBG
#include <ao_dbg.h>
@@
-514,15
+514,9
@@
struct ao_telemetry_raw_recv {
/* Set delay between telemetry reports (0 to disable) */
/* Set delay between telemetry reports (0 to disable) */
-#ifdef AO_SEND_ALL_BARO
-#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(100)
-#define AO_TELEMETRY_INTERVAL_FLIGHT AO_MS_TO_TICKS(100)
-#define AO_TELEMETRY_INTERVAL_RECOVER AO_MS_TO_TICKS(100)
-#else
#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(1000)
#define AO_TELEMETRY_INTERVAL_FLIGHT AO_MS_TO_TICKS(100)
#define AO_TELEMETRY_INTERVAL_RECOVER AO_MS_TO_TICKS(1000)
#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(1000)
#define AO_TELEMETRY_INTERVAL_FLIGHT AO_MS_TO_TICKS(100)
#define AO_TELEMETRY_INTERVAL_RECOVER AO_MS_TO_TICKS(1000)
-#endif
void
ao_telemetry_reset_interval(void);
void
ao_telemetry_reset_interval(void);
@@
-658,6
+652,7
@@
union ao_monitor {
extern __xdata union ao_monitor ao_monitor_ring[AO_MONITOR_RING];
#define ao_monitor_ring_next(n) (((n) + 1) & (AO_MONITOR_RING - 1))
extern __xdata union ao_monitor ao_monitor_ring[AO_MONITOR_RING];
#define ao_monitor_ring_next(n) (((n) + 1) & (AO_MONITOR_RING - 1))
+#define ao_monitor_ring_prev(n) (((n) - 1) & (AO_MONITOR_RING - 1))
extern __data uint8_t ao_monitoring;
extern __data uint8_t ao_monitor_head;
extern __data uint8_t ao_monitoring;
extern __data uint8_t ao_monitor_head;