Explorar el Código

nIRsensorLastTime

Voinea Dragos hace 3 años
padre
commit
78362419da
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      Firmware/fsensor.cpp

+ 3 - 3
Firmware/fsensor.cpp

@@ -124,7 +124,7 @@ uint16_t fsensor_oq_sh_sum;
 ClFsensorPCB oFsensorPCB;
 ClFsensorActionNA oFsensorActionNA;
 bool bIRsensorStateFlag=false;
-unsigned long nIRsensorLastTime;
+ShortTimer tIRsensorCheckTimer;
 #endif //IR_SENSOR_ANALOG
 
 void fsensor_stop_and_save_print(void)
@@ -693,11 +693,11 @@ void fsensor_update(void)
                 if(!bIRsensorStateFlag)
                 {
                     bIRsensorStateFlag=true;
-                    nIRsensorLastTime=_millis();
+                    tIRsensorCheckTimer.start();
                 }
                 else
                 {
-                    if((_millis()-nIRsensorLastTime)>IR_SENSOR_STEADY)
+                    if(tIRsensorCheckTimer.expired(IR_SENSOR_STEADY))
                     {
                         uint8_t nMUX1,nMUX2;
                         uint16_t nADC;