From 4fb792447e037cabbd4800f40e4fabeb44d6c143 Mon Sep 17 00:00:00 2001 From: Steffen Gaisser Date: Tue, 20 Apr 2021 17:29:56 +0200 Subject: [PATCH] Small rearragenment in Heater.cpp --- thermal/Heater.cpp | 7 +++---- thermal/Heater.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/thermal/Heater.cpp b/thermal/Heater.cpp index 8bfa030b9..aeade8d1d 100644 --- a/thermal/Heater.cpp +++ b/thermal/Heater.cpp @@ -5,10 +5,9 @@ #include "../ipc/QueueFactory.h" Heater::Heater(uint32_t objectId, uint8_t switch0, uint8_t switch1) : -HealthDevice(objectId, 0), internalState(STATE_OFF), powerSwitcher( - NULL), pcduQueueId(0), switch0(switch0), switch1(switch1), wasOn(false), timedOut(false), - reactedToBeingFaulty(false), passive(false), eventQueue(NULL), - heaterOnCountdown(10800000)/*about two orbits*/, parameterHelper(this), lastAction(CLEAR) { +HealthDevice(objectId, 0), internalState(STATE_OFF), switch0(switch0), switch1(switch1), + heaterOnCountdown(10800000)/*about two orbits*/, + parameterHelper(this) { eventQueue = QueueFactory::instance()->createMessageQueue(); } diff --git a/thermal/Heater.h b/thermal/Heater.h index 19f13c793..2caddd852 100644 --- a/thermal/Heater.h +++ b/thermal/Heater.h @@ -57,28 +57,28 @@ protected: // no need for any special treatment is needed } internalState; - PowerSwitchIF *powerSwitcher; - MessageQueueId_t pcduQueueId; + PowerSwitchIF *powerSwitcher = nullptr; + MessageQueueId_t pcduQueueId = MessageQueueIF::NO_QUEUE; uint8_t switch0; uint8_t switch1; - bool wasOn; + bool wasOn = false; - bool timedOut; + bool timedOut = false; - bool reactedToBeingFaulty; + bool reactedToBeingFaulty = false; - bool passive; + bool passive = false; - MessageQueueIF* eventQueue; + MessageQueueIF* eventQueue = nullptr; Countdown heaterOnCountdown; Countdown switchCountdown; ParameterHelper parameterHelper; enum Action { SET, CLEAR - } lastAction; + } lastAction = CLEAR; void doAction(Action action);