projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Allow pyro flight state config to be set
[fw/altos]
/
src
/
core
/
ao_convert_pa.c
diff --git
a/src/core/ao_convert_pa.c
b/src/core/ao_convert_pa.c
index 1413681d9f9b7c591f6cc5069978bca4e033d1ed..55fe6e7da0e3a0ad5c4110b41f2722fc756bbc87 100644
(file)
--- a/
src/core/ao_convert_pa.c
+++ b/
src/core/ao_convert_pa.c
@@
-19,10
+19,18
@@
#include "ao.h"
#endif
#include "ao.h"
#endif
-static const int32_t altitude_table[] = {
+#ifndef AO_CONST_ATTRIB
+#define AO_CONST_ATTRIB
+#endif
+
+static const alt_t altitude_table[] AO_CONST_ATTRIB = {
#include "altitude-pa.h"
};
#include "altitude-pa.h"
};
+#ifndef FETCH_ALT
+#define FETCH_ALT(o) altitude_table[o]
+#endif
+
#define ALT_SCALE (1 << ALT_SHIFT)
#define ALT_MASK (ALT_SCALE - 1)
#define ALT_SCALE (1 << ALT_SHIFT)
#define ALT_MASK (ALT_SCALE - 1)
@@
-45,6
+53,7
@@
ao_pa_to_altitude(int32_t pa)
return (low + high) >> ALT_SHIFT;
}
return (low + high) >> ALT_SHIFT;
}
+#ifdef AO_CONVERT_TEST
int32_t
ao_altitude_to_pa(int32_t alt)
{
int32_t
ao_altitude_to_pa(int32_t alt)
{
@@
-70,3
+79,4
@@
ao_altitude_to_pa(int32_t alt)
pa = 0;
return pa;
}
pa = 0;
return pa;
}
+#endif