diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-08-20 20:45:17 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-08-20 20:45:17 +0200 |
commit | b78e2f7d45cf8f1e50db3c8a4ea7821b864b0075 (patch) | |
tree | c31498c8c34a9d14a80a464d4030d5a5371b1d9c /src | |
parent | 706113eca974006062365dd000c44eacbb09aeb7 (diff) | |
download | glutte-o-matic-b78e2f7d45cf8f1e50db3c8a4ea7821b864b0075.tar.gz glutte-o-matic-b78e2f7d45cf8f1e50db3c8a4ea7821b864b0075.tar.bz2 glutte-o-matic-b78e2f7d45cf8f1e50db3c8a4ea7821b864b0075.zip |
Remove runtime reset of SWR error
Only a full system reset can clear the high SWR error.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/src/Core/main.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index 48a77c9..fa7f057 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -48,20 +48,21 @@ #include "GPIO/analog.h" #include "vc.h" - -// Private variables static int tm_trigger_button = 0; static int tm_trigger = 0; +/* Threshold for SWR measurement */ +const int swr_refl_threshold = 10; // mV + /* Saturating counter for SWR measurement * * Hysteresis: * If the counter reaches the max value, the - * SWR Error is triggered. Once the counter - * reaches the min value, the error is - * cleared again. + * SWR Error is triggered. + * + * The error can only be cleared through + * a full reset. */ -#define SWR_ERROR_COUNTER_MIN 0 #define SWR_ERROR_COUNTER_MAX 10 static int swr_error_counter = 0; static int swr_error_flag = 0; @@ -231,7 +232,6 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters) if (fsm_out.tx_on) { int swr_fwd_mv, swr_refl_mv; - const int swr_refl_threshold = 10; // mV if (analog_measure_swr(&swr_fwd_mv, &swr_refl_mv)) { if (swr_refl_mv > swr_refl_threshold) { usart_debug("SWR meas %d mV\r\n", swr_refl_mv); @@ -245,11 +245,6 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters) swr_error_counter = SWR_ERROR_COUNTER_MAX; swr_error_flag = 1; } - - if (swr_error_counter < SWR_ERROR_COUNTER_MIN) { - swr_error_counter = SWR_ERROR_COUNTER_MIN; - swr_error_flag = 0; - } } } } |