diff options
author | Maximilien Cuony <maximilien@theglu.org> | 2016-09-04 17:59:22 +0200 |
---|---|---|
committer | Maximilien Cuony <maximilien@theglu.org> | 2016-09-04 17:59:22 +0200 |
commit | 1a57a0ddd9d67569c1ada918547b5743f0b1afc5 (patch) | |
tree | 1e2aafc04dd6e943d3e77202e5732ff0804ef248 /src/common | |
parent | ef6aff66dc9f773d53aaf3073daa1181a0ffa89b (diff) | |
download | glutte-o-matic-1a57a0ddd9d67569c1ada918547b5743f0b1afc5.tar.gz glutte-o-matic-1a57a0ddd9d67569c1ada918547b5743f0b1afc5.tar.bz2 glutte-o-matic-1a57a0ddd9d67569c1ada918547b5743f0b1afc5.zip |
Fix override of hour evenness
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/src/Core/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index ab37d3e..551ec61 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -51,6 +51,7 @@ static int tm_trigger_button = 0; static struct fsm_input_signals_t fsm_input; +static int hour_is_even = 0; /* Threshold for SWR measurement */ const int swr_refl_threshold = 10; // mV @@ -374,12 +375,12 @@ static void gps_monit_task(void __attribute__ ((unused))*pvParameters) { } if (time_valid) { - fsm_input.hour_is_even = (time.tm_hour + 1) % 2; + hour_is_even = (time.tm_hour + 1) % 2; - if (last_even != fsm_input.hour_is_even) { - last_even = fsm_input.hour_is_even; + if (last_even != hour_is_even) { + last_even = hour_is_even; - usart_debug("Even changed: %i %i %i %i\r\n", fsm_input.hour_is_even, time.tm_hour, derived_mode); + usart_debug("Even changed: %i %i %i\r\n", hour_is_even, time.tm_hour, derived_mode); } } @@ -529,6 +530,7 @@ static void exercise_fsm(void __attribute__ ((unused))*pvParameters) } fsm_input.swr_high = swr_error_flag; + fsm_input.hour_is_even = hour_is_even; fsm_update_inputs(&fsm_input); fsm_update(); |