aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-09 21:10:51 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-09 21:10:51 +0200
commit7cbb03e3e7fbe584b3764dfc8b5486811ee4d929 (patch)
tree517b56b3b5af2d0760b96306f56035104bd539ff /src
parent91a2ed0ac3a27f379001eea36480be74378e89d8 (diff)
downloadglutte-o-matic-7cbb03e3e7fbe584b3764dfc8b5486811ee4d929.tar.gz
glutte-o-matic-7cbb03e3e7fbe584b3764dfc8b5486811ee4d929.tar.bz2
glutte-o-matic-7cbb03e3e7fbe584b3764dfc8b5486811ee4d929.zip
Add BUG_1750_BROKEN workaround
Diffstat (limited to 'src')
-rw-r--r--src/common/src/Core/fsm.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/common/src/Core/fsm.c b/src/common/src/Core/fsm.c
index 527c2ca..735b8d6 100644
--- a/src/common/src/Core/fsm.c
+++ b/src/common/src/Core/fsm.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony
+ * Copyright (c) 2018 Matthias P. Braendli, Maximilien Cuony
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -31,6 +31,12 @@
#include "GPIO/temperature.h"
#include "GPIO/analog.h"
+/* Set this flag to 1 to disable the usage of the 1750 signal in the FSM.
+ * This is used because the external 1750Hz detector is broken, and we temporarily
+ * want to run the repeater in open-through-carrier mode.
+ */
+#define BUG_1750_BROKEN 1
+
static struct fsm_input_signals_t fsm_in;
static struct fsm_output_signals_t fsm_out;
@@ -212,9 +218,15 @@ void fsm_update() {
short_beacon_counter_s++;
}
+#if defined(BUG_1750_BROKEN)
+ if (fsm_in.sq) {
+ next_state = FSM_OPEN1;
+ }
+#else
if (fsm_in.tone_1750 | (fsm_in.sq && sstv_state == SSTV_FSM_ON)) {
next_state = FSM_OPEN1;
}
+#endif
else if (balise_state == BALISE_FSM_PENDING) {
short_beacon_counter_s = 0;
next_state = select_grande_balise();
@@ -230,9 +242,15 @@ void fsm_update() {
/* Do not enable TX_ON here, otherwise we could get stuck transmitting
* forever if SQ never goes low.
*/
+#if defined(BUG_1750_BROKEN)
+ if (!fsm_in.sq) {
+ next_state = FSM_OPEN2;
+ }
+#else
if (!fsm_in.sq && !fsm_in.tone_1750) {
next_state = FSM_OPEN2;
}
+#endif
break;
case FSM_OPEN2: