inititalize loop indexes #561

Merged
muellerr merged 1 commits from tcs_bugfix into develop 2023-04-04 14:26:01 +02:00

View File

@ -172,7 +172,7 @@ void ThermalController::performControlOperation() {
transitionToOffCycles++;
// if heater still ON after 10 cycles, switch OFF again
if (transitionToOffCycles == 10) {
for (uint8_t i; i < heater::Switchers::NUMBER_OF_SWITCHES; i++) {
for (uint8_t i = 0; i < heater::Switchers::NUMBER_OF_SWITCHES; i++) {
heaterHandler.switchHeater(static_cast<heater::Switchers>(i),
HeaterHandler::SwitchState::OFF);
}
@ -1745,7 +1745,7 @@ void ThermalController::tooHotHandlerWhichClearsOneShotFlag(object_id_t object,
void ThermalController::startTransition(Mode_t mode_, Submode_t submode_) {
triggerEvent(CHANGING_MODE, mode_, submode_);
if (mode_ == MODE_OFF) {
for (uint8_t i; i < heater::Switchers::NUMBER_OF_SWITCHES; i++) {
for (uint8_t i = 0; i < heater::Switchers::NUMBER_OF_SWITCHES; i++) {
heaterHandler.switchHeater(static_cast<heater::Switchers>(i),
HeaterHandler::SwitchState::OFF);
}