NT not US not MS

thank you Matt
This commit is contained in:
rusefi 2020-01-19 03:49:35 -05:00
parent 2e0a30859c
commit 7da4196f9c
3 changed files with 5 additions and 6 deletions

View File

@ -88,12 +88,11 @@ void SingleTimerExecutor::scheduleByTimestampNt(scheduling_s* scheduling, efitim
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
#if EFI_ENABLE_ASSERTS
int deltaTimeUs = nt - getTimeNowNt();
int deltaTimeUs = NT2US(nt - getTimeNowNt());
if (deltaTimeUs >= TOO_FAR_INTO_FUTURE) {
if (deltaTimeUs >= TOO_FAR_INTO_FUTURE_US) {
// we are trying to set callback for too far into the future. This does not look right at all
// this does not pass CI :(
// firmwareError(CUSTOM_ERR_TASK_TIMER_OVERFLOW, "scheduleByTimestampNt() too far: %d", deltaTimeUs);
firmwareError(CUSTOM_ERR_TASK_TIMER_OVERFLOW, "scheduleByTimestampNt() too far: %d", deltaTimeUs);
return;
}
#endif

View File

@ -82,7 +82,7 @@ void setHardwareUsTimer(int32_t deltaTimeUs) {
if (deltaTimeUs < 2)
deltaTimeUs = 2; // for some reason '1' does not really work
efiAssertVoid(CUSTOM_ERR_6681, deltaTimeUs > 0, "not positive deltaTimeUs");
if (deltaTimeUs >= TOO_FAR_INTO_FUTURE) {
if (deltaTimeUs >= TOO_FAR_INTO_FUTURE_US) {
// we are trying to set callback for too far into the future. This does not look right at all
firmwareError(CUSTOM_ERR_TIMER_OVERFLOW, "setHardwareUsTimer() too far: %d", deltaTimeUs);
// let's make this look special and NOT toggle enginePins.debugSetTimer

View File

@ -15,7 +15,7 @@ extern "C"
void initMicrosecondTimer(void);
void setHardwareUsTimer(int32_t deltaTimeUs);
#define TOO_FAR_INTO_FUTURE 10 * US_PER_SECOND
#define TOO_FAR_INTO_FUTURE_US 10 * US_PER_SECOND
#ifdef __cplusplus
}