]> git.gag.com Git - fw/altos/blobdiff - src/kernel/ao.h
doc: Add 1.9.22 release notes
[fw/altos] / src / kernel / ao.h
index edfbbb871de6416bdd0303bbe994b2215b39fd5d..1cfe29e9f55652c2b448cde57858cc3317f3957b 100644 (file)
 #ifndef _AO_H_
 #define _AO_H_
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
 #include <stddef.h>
+#include <stdarg.h>
 #include <stdbool.h>
 #include <ao_pins.h>
 #include <ao_arch.h>
@@ -666,6 +667,9 @@ ao_radio_test_on(void);
 void
 ao_radio_test_off(void);
 
+bool
+ao_radio_post(void);
+
 void
 ao_radio_init(void);
 
@@ -982,26 +986,4 @@ void ao_ms5607_init(void);
 
 #include <ao_arch_funcs.h>
 
-/*
- * dv = (sensor * (p+m) * ref_dv)/ (max * m)
- * value * (max * m) = (sensor * (p+m) * ref)
- * value * (max * m) / ((p+m) * ref) = sensor
- */
-
-#define AO_DV_MUL(p,m) ((int32_t) AO_ADC_MAX * (m))
-#define AO_DV_DIV(p,m) ((int32_t) AO_ADC_REFERENCE_DV * ((p) + (m)))
-#define AO_DV_ADD(p,m) (AO_DV_DIV(p,m) / 2)
-
-#define ao_decivolt_to_adc(dv, p, m) \
-       ((int16_t) (((int32_t) (dv) * AO_DV_MUL(p,m) + AO_DV_ADD(p,m)) / AO_DV_DIV(p,m)))
-
-#define AO_IGNITER_CLOSED_DV   35
-#define AO_IGNITER_OPEN_DV     10
-
-#undef AO_IGNITER_OPEN
-#undef AO_IGNITER_CLOSED
-
-#define AO_IGNITER_OPEN ao_decivolt_to_adc(AO_IGNITER_OPEN_DV, AO_IGNITE_DIV_PLUS, AO_IGNITE_DIV_MINUS)
-#define AO_IGNITER_CLOSED ao_decivolt_to_adc(AO_IGNITER_CLOSED_DV, AO_IGNITE_DIV_PLUS, AO_IGNITE_DIV_MINUS)
-
 #endif /* _AO_H_ */