|
|
|
|
|
|
|
|
DBG_PRINT(TICKS_HIGH(desired), DEC); |
|
|
DBG_PRINT(TICKS_HIGH(desired), DEC); |
|
|
|
|
|
|
|
|
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired))); |
|
|
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired))); |
|
|
if (passed) |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
else |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
return passed; |
|
|
|
|
|
|
|
|
if (passed) { |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
} else { |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
} |
|
|
|
|
|
return passed; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//+======================================================== |
|
|
//+======================================================== |
|
|
|
|
|
|
|
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC); |
|
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC); |
|
|
DBG_PRINT(F("us vs ")); |
|
|
DBG_PRINT(F("us vs ")); |
|
|
DBG_PRINT(desired_us, DEC); |
|
|
DBG_PRINT(desired_us, DEC); |
|
|
DBG_PRINT("us"); |
|
|
|
|
|
|
|
|
DBG_PRINT("us"); |
|
|
DBG_PRINT(": "); |
|
|
DBG_PRINT(": "); |
|
|
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC); |
|
|
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC); |
|
|
DBG_PRINT(F(" <= ")); |
|
|
DBG_PRINT(F(" <= ")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS)) |
|
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS)) |
|
|
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS))); |
|
|
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS))); |
|
|
if (passed) |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
else |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
return passed; |
|
|
|
|
|
|
|
|
if (passed) { |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
} else { |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
} |
|
|
|
|
|
return passed; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//+======================================================== |
|
|
//+======================================================== |
|
|
|
|
|
|
|
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC); |
|
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC); |
|
|
DBG_PRINT(F("us vs ")); |
|
|
DBG_PRINT(F("us vs ")); |
|
|
DBG_PRINT(desired_us, DEC); |
|
|
DBG_PRINT(desired_us, DEC); |
|
|
DBG_PRINT("us"); |
|
|
|
|
|
|
|
|
DBG_PRINT("us"); |
|
|
DBG_PRINT(": "); |
|
|
DBG_PRINT(": "); |
|
|
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC); |
|
|
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC); |
|
|
DBG_PRINT(F(" <= ")); |
|
|
DBG_PRINT(F(" <= ")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS)) |
|
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS)) |
|
|
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS))); |
|
|
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS))); |
|
|
if (passed) |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
else |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
return passed; |
|
|
|
|
|
|
|
|
if (passed) { |
|
|
|
|
|
DBG_PRINTLN(F("?; passed")); |
|
|
|
|
|
} else { |
|
|
|
|
|
DBG_PRINTLN(F("?; FAILED")); |
|
|
|
|
|
} |
|
|
|
|
|
return passed; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//+============================================================================= |
|
|
//+============================================================================= |