X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcore%2Fao.h;h=a4136a9b2fea02707dd6e5ad0709d25082bca8a8;hb=06afa2c3e78ea5bc9f1eb4913ee35c0eab0ac1bf;hp=27b9c5c469717112161a72ecdb498a4098bb6ed8;hpb=0667261e03b3fd403e97d02ea6204b007bb13f58;p=fw%2Faltos diff --git a/src/core/ao.h b/src/core/ao.h index 27b9c5c4..a4136a9b 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -115,6 +115,7 @@ ao_start_scheduler(void); #define AO_PANIC_BT 11 /* Communications with bluetooth device failed */ #define AO_PANIC_STACK 12 /* Stack overflow */ #define AO_PANIC_SPI 13 /* SPI communication failure */ +#define AO_PANIC_SELF_TEST 14 /* Self test failure */ /* Stop the operating system, beeping and blinking the reason */ void @@ -282,6 +283,18 @@ ao_altitude_to_pres(int16_t alt) __reentrant; int16_t ao_temp_to_dC(int16_t temp) __reentrant; +/* + * ao_convert_pa.c + * + * Convert between pressure in Pa and altitude in meters + */ + +int32_t +ao_pa_to_altitude(int32_t pa); + +int32_t +ao_altitude_to_pa(int32_t alt); + #if HAS_DBG #include #endif @@ -561,6 +574,16 @@ ao_gps_report_init(void); * ao_telemetry_orig.c */ +struct ao_adc_orig { + uint16_t tick; /* tick when the sample was read */ + int16_t accel; /* accelerometer */ + int16_t pres; /* pressure sensor */ + int16_t temp; /* temperature sensor */ + int16_t v_batt; /* battery voltage */ + int16_t sense_d; /* drogue continuity sense */ + int16_t sense_m; /* main continuity sense */ +}; + struct ao_telemetry_orig { uint16_t serial; uint16_t flight; @@ -578,7 +601,7 @@ struct ao_telemetry_orig { int16_t ground_pres; int16_t accel_plus_g; int16_t accel_minus_g; - struct ao_adc adc; + struct ao_adc_orig adc; struct ao_gps_orig gps; char callsign[AO_MAX_CALLSIGN]; struct ao_gps_tracking_orig gps_tracking;