Mercurial > public > ostc4
diff Discovery/Src/settings.c @ 375:4bb5ceebfaf9 MotionDetection
Use Enum values for initialization and setting check:
Scroll function could not be restored because of invalid setting plausibility check =>Use enums to determine proper max value for the MotionDetection parameter
author | ideenmodellierer |
---|---|
date | Tue, 10 Sep 2019 20:51:55 +0200 |
parents | 75eedde05ff6 |
children | 14fd5f35cb50 |
line wrap: on
line diff
--- a/Discovery/Src/settings.c Sun Sep 08 13:45:43 2019 +0200 +++ b/Discovery/Src/settings.c Tue Sep 10 20:51:55 2019 +0200 @@ -32,6 +32,7 @@ #include "externLogbookFlash.h" // for SAMPLESTART and SAMPLESTOP #include "text_multilanguage.h" // for LANGUAGE_END #include "tHome.h" // for CVIEW_END +#include "Motion.h" SSettings Settings; @@ -307,7 +308,7 @@ .FactoryButtonBalance[2] = 3, .FlipDisplay = 0, .cv_configuration = 0xFFFFFFFF, - .MotionDetection = 0, + .MotionDetection = MOTION_DETECT_OFF, }; /* Private function prototypes -----------------------------------------------*/ @@ -453,7 +454,7 @@ pSettings->cv_configuration = 0xFFFFFFFF; // no break case 0xFFFF0019: - pSettings->MotionDetection = 0; + pSettings->MotionDetection = MOTION_DETECT_OFF; // no break default: pSettings->header = pStandard->header; @@ -1352,9 +1353,9 @@ Settings.FlipDisplay = 0; corrections++; } - if(Settings.MotionDetection > 2) /* At the moment only two detection functions available */ + if(Settings.MotionDetection >= MOTION_DETECT_END) { - Settings.MotionDetection = 0; + Settings.MotionDetection = MOTION_DETECT_OFF; corrections++; }