use correct clock API in TCS CTRL #738

Merged
muellerr merged 1 commits from small-tcs-fix into main 2023-07-12 10:29:50 +02:00

View File

@ -1852,7 +1852,7 @@ void ThermalController::resetThermalStates() {
void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::SwitchState targetState,
std::optional<unsigned> componentIdx) {
timeval currentTime;
Clock::getClockMonotonic(&currentTime);
Clock::getClock(&currentTime);
if (targetState == heater::SwitchState::ON) {
heaterHandler.switchHeater(switchNr, targetState);
heaterStates[switchNr].target = heater::SwitchState::ON;
@ -1879,7 +1879,7 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::Swit
void ThermalController::heaterSwitchHelperAllOff() {
timeval currentTime;
Clock::getClockMonotonic(&currentTime);
Clock::getClock(&currentTime);
size_t idx = 0;
for (; idx < heater::Switch::NUMBER_OF_SWITCHES; idx++) {
heaterHandler.switchHeater(static_cast<heater::Switch>(idx), heater::SwitchState::OFF);
@ -1901,7 +1901,7 @@ void ThermalController::crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(
for (unsigned j = 0; j < thermalStates.size(); j++) {
if (thermalStates[j].heating and thermalStates[j].heaterSwitch == switchIdx) {
timeval currentTime;
Clock::getClockMonotonic(&currentTime);
Clock::getClock(&currentTime);
thermalStates[j].heating = false;
thermalStates[j].heaterEndTime = currentTime.tv_sec;
}