X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fao.h;h=2df81d2a7285d8230d91f86e5c75c138079fead5;hb=03092d1a72a9651711e22c58dca6d6aba5705c5e;hp=4cceefe101a0306a57ae53c804ec5efe245b5e09;hpb=b219801fb0e5eaff7778d21701da977104522da3;p=fw%2Faltos diff --git a/src/ao.h b/src/ao.h index 4cceefe1..2df81d2a 100644 --- a/src/ao.h +++ b/src/ao.h @@ -107,6 +107,7 @@ ao_start_scheduler(void); #define AO_PANIC_LOG 5 /* Failing to read/write log data */ #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 */ /* Stop the operating system, beeping and blinking the reason */ void @@ -117,8 +118,9 @@ ao_panic(uint8_t reason); */ /* Our timer runs at 100Hz */ -#define AO_MS_TO_TICKS(ms) ((ms) / 10) -#define AO_SEC_TO_TICKS(s) ((s) * 100) +#define AO_HERTZ 100 +#define AO_MS_TO_TICKS(ms) ((ms) / (1000 / AO_HERTZ)) +#define AO_SEC_TO_TICKS(s) ((s) * AO_HERTZ) /* Returns the current time in ticks */ uint16_t @@ -349,6 +351,9 @@ ao_cmd_hex(void); void ao_cmd_decimal(void); +uint8_t +ao_match_word(__code char *word); + struct ao_cmds { char cmd; void (*func)(void); @@ -783,6 +788,7 @@ ao_gps_report_init(void); */ #define AO_MAX_CALLSIGN 8 +#define AO_TELEMETRY_VERSION 1 struct ao_telemetry { uint8_t addr; @@ -792,6 +798,8 @@ struct ao_telemetry { int32_t flight_vel; int16_t flight_pres; int16_t ground_pres; + int16_t accel_plus_g; + int16_t accel_minus_g; struct ao_adc adc; struct ao_gps_data gps; char callsign[AO_MAX_CALLSIGN]; @@ -928,16 +936,17 @@ ao_igniter_init(void); */ #define AO_CONFIG_MAJOR 1 -#define AO_CONFIG_MINOR 1 +#define AO_CONFIG_MINOR 2 struct ao_config { uint8_t major; uint8_t minor; uint16_t main_deploy; - int16_t accel_zero_g; + int16_t accel_plus_g; uint8_t radio_channel; char callsign[AO_MAX_CALLSIGN + 1]; uint8_t apogee_delay; + int16_t accel_minus_g; }; extern __xdata struct ao_config ao_config;