use correct clock API
This commit is contained in:
parent
74859dd5c6
commit
54309b512f
@ -1852,7 +1852,7 @@ void ThermalController::resetThermalStates() {
|
||||
void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::SwitchState targetState,
|
||||
std::optional<unsigned> componentIdx) {
|
||||
timeval currentTime;
|
||||
Clock::getClockMonotonic(¤tTime);
|
||||
Clock::getClock(¤tTime);
|
||||
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(¤tTime);
|
||||
Clock::getClock(¤tTime);
|
||||
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(¤tTime);
|
||||
Clock::getClock(¤tTime);
|
||||
thermalStates[j].heating = false;
|
||||
thermalStates[j].heaterEndTime = currentTime.tv_sec;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user