delay, micros for the 3.7.x branch

This commit is contained in:
DRracer 2019-07-23 16:40:21 +02:00
parent 6860a572c2
commit 593675c667

View File

@ -3298,15 +3298,15 @@ static void gcode_PRUSA_BadRAMBoFanTest(){
//printf_P(PSTR("TACH_1: %d\n"), tach1cntr);
SET_OUTPUT(TACH_1);
WRITE(TACH_1, LOW);
delay2(20); // the delay may be lower
unsigned long tachMeasure = micros2();
delay(20); // the delay may be lower
unsigned long tachMeasure = micros();
cli();
SET_INPUT(TACH_1);
// just wait brutally in an endless cycle until we reach HIGH
// if this becomes a problem it may be improved to non-endless cycle
while( READ(TACH_1) == 0 ) ;
sei();
tachMeasure = micros2() - tachMeasure;
tachMeasure = micros() - tachMeasure;
if( tach1max < tachMeasure )
tach1max = tachMeasure;
//printf_P(PSTR("TACH_1: %d: capacitor check time=%lu us\n"), (int)tach1cntr, tachMeasure);