From f809d670fbfcfad07fccb8a516b6b25302c81c4d Mon Sep 17 00:00:00 2001 From: PS Date: Thu, 22 Apr 2021 13:09:31 -1000 Subject: [PATCH] Added motor time range logging --- src/app/ss_blumen_lumen/blumen_lumen.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/app/ss_blumen_lumen/blumen_lumen.cpp b/src/app/ss_blumen_lumen/blumen_lumen.cpp index 6e0995c..ece98e7 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen.cpp +++ b/src/app/ss_blumen_lumen/blumen_lumen.cpp @@ -298,6 +298,21 @@ BlumenLumen_UpdateLog(app_state* State, blumen_lumen_state* BLState, context Con u8 MP2 = BLState->LastKnownMotorState.FlowerPositions[2]; AppendPrintF(&FileStr, "Last Known Motor State: %d %d %d\n", MP0, MP1, MP2); + time_range MotorRange = {}; + if (SystemTimeIsInTimeRangeList(Context.SystemTime_Current, + MotorOpenTimes, + MotorOpenTimesCount, + &MotorRange)) + { + AppendPrintF(&FileStr, "\tIn Motor-Open Time Range: ( %d:%d - %d:%d)\n", + MotorRange.StartHour, MotorRange.StartMinute, + MotorRange.EndHour, MotorRange.EndMinute); + } + else + { + AppendPrintF(&FileStr, "\tIn Motor-Open Time Range: None\n"); + } + char* PatternMode = 0; switch (BLState->PatternMode) {