diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-07-17 17:37:24 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-07-17 17:46:22 +0200 |
commit | e71c4654eac1738e5e39bbb3e6bc7b0d645d2a61 (patch) | |
tree | c3c171f785c683c7a0557ac208a341661d2c88ac | |
parent | e54ef949a643be37195766aed6c3f664aba01c72 (diff) | |
download | glutte-o-matic-e71c4654eac1738e5e39bbb3e6bc7b0d645d2a61.tar.gz glutte-o-matic-e71c4654eac1738e5e39bbb3e6bc7b0d645d2a61.tar.bz2 glutte-o-matic-e71c4654eac1738e5e39bbb3e6bc7b0d645d2a61.zip |
Add QSO to ECOUTE fsm transition
-rw-r--r-- | src/common/src/Core/fsm.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/common/src/Core/fsm.c b/src/common/src/Core/fsm.c index a5b2d84..df37dc2 100644 --- a/src/common/src/Core/fsm.c +++ b/src/common/src/Core/fsm.c @@ -128,7 +128,7 @@ void fsm_update() { switch (current_state) { case FSM_OISIF: - // Check the lenght of the last QSO, and reset the SHORT_BEACON counter if needed + // Check the length of the last QSO, and reset the SHORT_BEACON counter if needed if (last_qso_start_timestamp != 0) { if ((timestamp_now() - last_qso_start_timestamp) > 1000 * SHORT_BEACON_RESET_IF_QSO) { @@ -138,7 +138,7 @@ void fsm_update() { last_qso_start_timestamp = 0; } - // Increment the SHORT_BEACON counter based on time spent in the state + // Increment the SHORT_BEACON counter based on time spent in the state if (short_beacon_counter_s < SHORT_BEACON_MAX) { while(short_beacon_counter_s < SHORT_BEACON_MAX && (fsm_current_state_time_s() - short_beacon_counter_last_update > 1)) { short_beacon_counter_last_update++; @@ -249,7 +249,14 @@ void fsm_update() { last_qso_start_timestamp = timestamp_now(); } - if (!fsm_in.sq) { + if (!fsm_in.sq && fsm_current_state_time_s() < 5) { + /* To avoid that very short open squelch triggers + * transmit CW letters all the time. Some people + * enjoy doing that. + */ + next_state = FSM_ECOUTE; + } + else if (!fsm_in.sq && fsm_current_state_time_s() >= 5) { next_state = FSM_LETTRE; } else if (fsm_current_state_time_s() > 5 * 60) { @@ -457,20 +464,19 @@ void fsm_update() { } else { //FSM_BALISE_COURTE_OPEN if (fsm_in.cw_psk31_done) { - if (fsm_in.sq) { next_state = FSM_OPEN1; } else { next_state = FSM_OPEN2; } - } + } break; default: - // Should never happen - next_state = FSM_OISIF; + // Should never happen + next_state = FSM_OISIF; break; } |