timers: create proper timeouts
This commit is contained in:
@@ -226,15 +226,20 @@ StateHandler::handleTickValue (int value)
|
||||
if (value > TIMER_PRESSURE_TIMEOUT)
|
||||
{
|
||||
SetState (&StateHandler::stateGetPressure);
|
||||
++sensor_timer;
|
||||
sensor_timer += value;
|
||||
error_timer += value;
|
||||
state_timer->resetCounter ();
|
||||
}
|
||||
if (value == TIMER_ERROR_VALUE)
|
||||
if (error_timer > TIMER_GLOBAL_TIMEOUT)
|
||||
{
|
||||
displaySet (ERROR_TIMEOUT);
|
||||
this->fan_speed.setInit (0);
|
||||
this->value[(current_mode)].setInit (0);
|
||||
saveSetAndDisplay(AUTO);
|
||||
displaySet (ERROR_TIMEOUT);
|
||||
SetState (&StateHandler::stateInit);
|
||||
state_timer->Sleep(2000);
|
||||
state_timer->resetCounter();
|
||||
error_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,6 @@ main (void)
|
||||
i1 = DWT->CYCCNT;
|
||||
|
||||
getcounterValue = glob_time.getCounter ();
|
||||
if (getcounterValue > TIMER_GLOBAL_TIMEOUT)
|
||||
{
|
||||
glob_time.resetCounter ();
|
||||
ventMachine.HandleState (Event (Event::eTick, TIMER_ERROR_VALUE));
|
||||
}
|
||||
sw_up.listen ();
|
||||
sw_down.listen ();
|
||||
sw_toggle.listen ();
|
||||
|
||||
Reference in New Issue
Block a user