diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-04 13:46:26 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-04 13:46:26 +0200 |
commit | fe8eb047b7350436a79eaf2c3c3b6e937d2f2d50 (patch) | |
tree | 5f58da60f479120f1e42d34aae69fea3f6f409fb /src/common/includes/Core/fsm.h | |
parent | 0957e3135cc8268939955b00333b79c6846f304e (diff) | |
download | glutte-o-matic-fe8eb047b7350436a79eaf2c3c3b6e937d2f2d50.tar.gz glutte-o-matic-fe8eb047b7350436a79eaf2c3c3b6e937d2f2d50.tar.bz2 glutte-o-matic-fe8eb047b7350436a79eaf2c3c3b6e937d2f2d50.zip |
Rework balise trigger and fix ECOUTE lockup
Diffstat (limited to 'src/common/includes/Core/fsm.h')
-rw-r--r-- | src/common/includes/Core/fsm.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/common/includes/Core/fsm.h b/src/common/includes/Core/fsm.h index 5ac353e..03025aa 100644 --- a/src/common/includes/Core/fsm.h +++ b/src/common/includes/Core/fsm.h @@ -48,13 +48,23 @@ enum fsm_state_e { typedef enum fsm_state_e fsm_state_t; +// List of all states the balise FSM of the relay can be in +enum balise_fsm_state_e { + BALISE_FSM_EVEN_HOUR = 0, // Even hours. + BALISE_FSM_ODD_HOUR, // Odd hours + BALISE_FSM_PENDING, // Waiting for transmission of balise +}; + +typedef enum balise_fsm_state_e balise_fsm_state_t; + + // All signals that the FSM can read, most of them are actually booleans struct fsm_input_signals_t { /* Signals coming from repeater electronics */ int sq; // Squelch detection int discrim_u; // FM discriminator says RX is too high in frequency int qrp; // The relay is currently running with low power - int start_tm; // 2-hour pulse + int hour_is_even; // 1 if hour is even float temp; // temperature in degrees C float humidity; // relative humidity, range [0-100] % int wind_generator_ok; // false if the generator is folded out of the wind @@ -83,8 +93,6 @@ struct fsm_output_signals_t { int cw_psk31_trigger; // Set to true to trigger a CW or PSK31 transmission. // PSK31 is sent if cw_dit_duration is 0 - /* Acknowledgements for input signals */ - int ack_start_tm; // Set to 1 to clear start_tm }; // Initialise local structures @@ -93,6 +101,8 @@ void fsm_init(void); // Call the FSM once and update the internal state void fsm_update(void); +void fsm_balise_update(void); + // Setter for inputs void fsm_update_inputs(struct fsm_input_signals_t* inputs); |