diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-04-19 18:42:28 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-04-19 18:42:28 +0200 |
commit | e0857bd199cd42d34629d2831210a480e8108728 (patch) | |
tree | 30e654b1545f10724aacede39328a7bda4e38678 /src/common | |
parent | d2ee0ff421f0108a49d82b8b01bf4d18dfe72be7 (diff) | |
download | glutte-o-matic-e0857bd199cd42d34629d2831210a480e8108728.tar.gz glutte-o-matic-e0857bd199cd42d34629d2831210a480e8108728.tar.bz2 glutte-o-matic-e0857bd199cd42d34629d2831210a480e8108728.zip |
Fix FAX detection and output
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/includes/Core/fsm.h | 4 | ||||
-rw-r--r-- | src/common/src/Core/fsm.c | 6 | ||||
-rw-r--r-- | src/common/src/Core/main.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/common/includes/Core/fsm.h b/src/common/includes/Core/fsm.h index 91bb231..ae12dae 100644 --- a/src/common/includes/Core/fsm.h +++ b/src/common/includes/Core/fsm.h @@ -117,7 +117,9 @@ void fsm_update(void); void fsm_balise_update(void); -void fsm_sstv_update(void); +// Update the FAX/SSTV state machine and return 1 if the 1750 notch filter must be +// disabled +int fsm_sstv_update(void); // Force a BALISE void fsm_balise_force(void); diff --git a/src/common/src/Core/fsm.c b/src/common/src/Core/fsm.c index c088fe0..2aaca3e 100644 --- a/src/common/src/Core/fsm.c +++ b/src/common/src/Core/fsm.c @@ -173,7 +173,7 @@ static const char* fsm_select_letter(void) { else if (fsm_in.qrp) { return letter_qrp; } - else if (fsm_in.fax_mode || sstv_state == SSTV_FSM_ON) { + else if (sstv_state == SSTV_FSM_ON) { return letter_sstv; } @@ -636,7 +636,7 @@ void fsm_balise_update() { balise_state = next_state; } -void fsm_sstv_update() { +int fsm_sstv_update() { sstv_fsm_state_t next_state = sstv_state; @@ -653,6 +653,7 @@ void fsm_sstv_update() { ) { next_state = SSTV_FSM_OFF; } +#warning "Disable FAX mode if 1750 is active for 5 seconds" break; default: @@ -667,4 +668,5 @@ void fsm_sstv_update() { sstv_state = next_state; + return sstv_state == SSTV_FSM_ON; } diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index ec38df5..3f45f02 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -590,15 +590,14 @@ static void exercise_fsm(void __attribute__ ((unused))*pvParameters) fsm_input.det_1750 = tone_1750_status(); pio_set_det_1750(fsm_input.det_1750); fsm_input.fax_mode = tone_fax_status(); - pio_set_fax(fsm_input.fax_mode); - fsm_input.swr_high = swr_error_flag; fsm_input.hour_is_even = hour_is_even; fsm_update_inputs(&fsm_input); fsm_update(); fsm_balise_update(); - fsm_sstv_update(); + const int disable_1750_filter = fsm_sstv_update(); + pio_set_fax(disable_1750_filter); struct fsm_output_signals_t fsm_out; fsm_get_outputs(&fsm_out); |