X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fao.h;h=1f27fe9247b290ccc9e2814229563c8f19c8152c;hb=327e5e782958e516a7b7a786ab6c176b0decb8b8;hp=c1a0f6e396228906e7b4942240a1a0049c9cf82f;hpb=524665fc221b0d483453c67b7211e282cebc8980;p=fw%2Faltos diff --git a/src/ao.h b/src/ao.h index c1a0f6e3..1f27fe92 100644 --- a/src/ao.h +++ b/src/ao.h @@ -108,6 +108,7 @@ ao_start_scheduler(void); #define AO_PANIC_CMD 6 /* Too many command sets registered */ #define AO_PANIC_STDIO 7 /* Too many stdio handlers registered */ #define AO_PANIC_REBOOT 8 /* Reboot failed */ +#define AO_PANIC_FLASH 9 /* Invalid flash part (or wrong blocksize) */ /* Stop the operating system, beeping and blinking the reason */ void @@ -330,6 +331,7 @@ enum ao_cmd_status { }; extern __xdata uint16_t ao_cmd_lex_i; +extern __xdata uint32_t ao_cmd_lex_u32; extern __xdata char ao_cmd_lex_c; extern __xdata enum ao_cmd_status ao_cmd_status; @@ -536,7 +538,7 @@ struct ao_log_record { } gps_altitude; struct { uint16_t svid; - uint8_t state; + uint8_t unused; uint8_t c_n; } gps_sat; struct { @@ -747,18 +749,8 @@ struct ao_gps_data { uint16_t v_error; /* m */ }; -#define SIRF_SAT_STATE_ACQUIRED (1 << 0) -#define SIRF_SAT_STATE_CARRIER_PHASE_VALID (1 << 1) -#define SIRF_SAT_BIT_SYNC_COMPLETE (1 << 2) -#define SIRF_SAT_SUBFRAME_SYNC_COMPLETE (1 << 3) -#define SIRF_SAT_CARRIER_PULLIN_COMPLETE (1 << 4) -#define SIRF_SAT_CODE_LOCKED (1 << 5) -#define SIRF_SAT_ACQUISITION_FAILED (1 << 6) -#define SIRF_SAT_EPHEMERIS_AVAILABLE (1 << 7) - struct ao_gps_sat_data { uint8_t svid; - uint8_t state; uint8_t c_n_1; }; @@ -844,6 +836,11 @@ extern __xdata uint8_t ao_radio_mutex; void ao_radio_general_isr(void) interrupt 16; +void +ao_radio_get(void); + +#define ao_radio_put() ao_mutex_put(&ao_radio_mutex) + void ao_radio_set_telemetry(void); @@ -947,17 +944,18 @@ ao_igniter_init(void); */ #define AO_CONFIG_MAJOR 1 -#define AO_CONFIG_MINOR 2 +#define AO_CONFIG_MINOR 3 struct ao_config { uint8_t major; uint8_t minor; uint16_t main_deploy; - int16_t accel_plus_g; + int16_t accel_plus_g; /* changed for minor version 2 */ uint8_t radio_channel; char callsign[AO_MAX_CALLSIGN + 1]; - uint8_t apogee_delay; - int16_t accel_minus_g; + uint8_t apogee_delay; /* minor version 1 */ + int16_t accel_minus_g; /* minor version 2 */ + uint32_t radio_cal; /* minor version 3 */ }; extern __xdata struct ao_config ao_config;