altos: Parameterize altitude table access and initialization
[fw/altos] / src / core / ao_convert_pa.c
index 1413681d9f9b7c591f6cc5069978bca4e033d1ed..2793b77cfad2a948370fc02baf98f8c15c7d45be 100644 (file)
 #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"
 };
 
+#ifndef FETCH_ALT
+#define FETCH_ALT(o)   altitude_table[o]
+#endif
+
 #define ALT_SCALE      (1 << ALT_SHIFT)
 #define ALT_MASK       (ALT_SCALE - 1)