diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-05-29 14:48:11 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-05-29 14:48:11 +0200 |
commit | 69a8590bf0d8c099dbd1096888867e72bf601a89 (patch) | |
tree | d75231c4f060e71555f1bee9da18ee48c03a73f4 | |
parent | 7d91c4db01385c22d4bd01b7fe180adacb6480b5 (diff) | |
download | glutte-o-matic-69a8590bf0d8c099dbd1096888867e72bf601a89.tar.gz glutte-o-matic-69a8590bf0d8c099dbd1096888867e72bf601a89.tar.bz2 glutte-o-matic-69a8590bf0d8c099dbd1096888867e72bf601a89.zip |
Add start_tm ack signal
-rw-r--r-- | src/fsm/fsm.c | 2 | ||||
-rw-r--r-- | src/fsm/fsm.h | 3 | ||||
-rw-r--r-- | src/fsm/main.c | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/fsm/fsm.c b/src/fsm/fsm.c index 928478f..9c761e3 100644 --- a/src/fsm/fsm.c +++ b/src/fsm/fsm.c @@ -278,6 +278,7 @@ void fsm_update() { fsm_out.tx_on = 1; fsm_out.msg_frequency = 588; fsm_out.cw_dit_duration = 110; + fsm_out.ack_start_tm = 1; // TODO transmit humidity // TODO read voltage @@ -302,6 +303,7 @@ void fsm_update() { fsm_out.tx_on = 1; fsm_out.msg_frequency = 696; fsm_out.cw_dit_duration = 70; + fsm_out.ack_start_tm = 1; // TODO read voltage if (fsm_in.wind_generator_ok) { diff --git a/src/fsm/fsm.h b/src/fsm/fsm.h index e9a5ba7..690fc2e 100644 --- a/src/fsm/fsm.h +++ b/src/fsm/fsm.h @@ -82,6 +82,9 @@ struct fsm_output_signals_t { int cw_dit_duration; // CW speed, dit duration in ms 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 diff --git a/src/fsm/main.c b/src/fsm/main.c index 1376b4b..bc8501a 100644 --- a/src/fsm/main.c +++ b/src/fsm/main.c @@ -344,7 +344,11 @@ static void exercise_fsm(void *pvParameters) usart_debug("In QRP %d\r\n", last_qrp); } - fsm_input.start_tm = (tm_trigger == 1 && last_tm_trigger == 0) ? 1 : 0; + + if (tm_trigger == 1 && last_tm_trigger == 0) { + fsm_input.start_tm = 1; + } + last_tm_trigger = tm_trigger; fsm_input.cw_psk31_done = !cw_psk31_busy(); @@ -371,6 +375,10 @@ static void exercise_fsm(void *pvParameters) cw_psk31_push_message(fsm_out.msg, fsm_out.cw_dit_duration, fsm_out.msg_frequency); } cw_last_trigger = fsm_out.cw_psk31_trigger; + + if (fsm_out.ack_start_tm) { + fsm_input.start_tm = 0; + } } } |