use correct clock API
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-07-11 17:29:27 +02:00
parent 74859dd5c6
commit 54309b512f
Signed by: muellerr
GPG Key ID: A649FB78196E3849

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;
}