diff options
-rw-r--r-- | device-functions.c | 3 | ||||
-rw-r--r-- | globals.c | 3 | ||||
-rw-r--r-- | globals.h | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/device-functions.c b/device-functions.c index 338fce7..f2d7aec 100644 --- a/device-functions.c +++ b/device-functions.c @@ -123,7 +123,8 @@ void Main_Rst (void) globals.Timers.normal_relay_bounce_time_in_milliseconds=1.0e3 * globals.Flash.relay_delay_in_sec; globals.Timers.Relay_Switching_Delay_in_Milliseconds=globals.Timers.normal_relay_bounce_time_in_milliseconds; - // FIXME - check which misc globals should be reset here! + // reset all transient flags + globals.Flags = globals.DefaultFlags; Menu_Clear_Buttons(); } @@ -1,8 +1,11 @@ #include "globals.h" #include <time.h> + GlobalStruct globals = { .Flags.do_check_settings = 1, + .DefaultFlags.do_check_settings = 1, + .Registers.last_rise_time_relay_setting = 99 }; @@ -728,6 +728,9 @@ typedef struct { } ErrorStruct; + +// note flags with non-zero default/reset values in globals.c +// for example, do_check_settings=1 by default typedef struct { int extended_ampl_min_max; int do_check_settings; @@ -754,12 +757,12 @@ typedef struct { ChangeStruct Changes; ErrorStruct Errors; FlagStruct Flags; + FlagStruct DefaultFlags; TimeStruct Timers; } GlobalStruct; extern GlobalStruct globals; - #endif |