summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device-functions.c3
-rw-r--r--globals.c3
-rw-r--r--globals.h5
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();
}
diff --git a/globals.c b/globals.c
index 8f60930..636c535 100644
--- a/globals.c
+++ b/globals.c
@@ -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
};
diff --git a/globals.h b/globals.h
index 66281c0..5b60671 100644
--- a/globals.h
+++ b/globals.h
@@ -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