diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-24 13:09:48 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-24 13:09:48 -0400 |
commit | 6289747b35eef38cca5d5d3076b4ec6d33f9053f (patch) | |
tree | 12b1a38708e4d5e15e8712e4e469eb626a925692 | |
parent | badac819cb07b684197295f2b516a023a4725a62 (diff) |
set flags to default values upon reset
-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 |