aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-19 18:42:28 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-19 18:42:28 +0200
commite0857bd199cd42d34629d2831210a480e8108728 (patch)
tree30e654b1545f10724aacede39328a7bda4e38678 /src
parentd2ee0ff421f0108a49d82b8b01bf4d18dfe72be7 (diff)
downloadglutte-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')
-rw-r--r--src/common/includes/Core/fsm.h4
-rw-r--r--src/common/src/Core/fsm.c6
-rw-r--r--src/common/src/Core/main.c5
-rw-r--r--src/glutt-o-logique/audio_in.c3
-rw-r--r--src/glutt-o-logique/pio.c1
5 files changed, 10 insertions, 9 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);
diff --git a/src/glutt-o-logique/audio_in.c b/src/glutt-o-logique/audio_in.c
index fa3b8bb..f05d5cc 100644
--- a/src/glutt-o-logique/audio_in.c
+++ b/src/glutt-o-logique/audio_in.c
@@ -149,7 +149,6 @@ void audio_in_enable(int enable)
TIM_Cmd(TIM6, enable ? ENABLE : DISABLE);
}
-#warning "Test tone detector activation from FSM"
-#warning "Test 1750 not triggered by start bip my yaesu makes"
+#warning "Do an analog anti-aliasing filter"
#warning "Test DTMF detector"
#warning "Test if FAX mode gets enabled after 0-7-*"
diff --git a/src/glutt-o-logique/pio.c b/src/glutt-o-logique/pio.c
index ba52282..948a330 100644
--- a/src/glutt-o-logique/pio.c
+++ b/src/glutt-o-logique/pio.c
@@ -72,7 +72,6 @@
GPIOC_PIN_U | \
GPIOC_PIN_D | \
GPIOC_PIN_REPLIE | \
- GPIOC_PIN_FAX | \
0 )
#define GPIOD_OUTPUT_PINS ( \