Timestamp Error scheduleByTimestampNt too far #3395
improving error message
This commit is contained in:
parent
11453c79f6
commit
500c443a15
|
@ -64,6 +64,6 @@ struct ExecutorInterface {
|
||||||
*/
|
*/
|
||||||
virtual void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) = 0;
|
virtual void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) = 0;
|
||||||
virtual void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitime_t timeUs, action_s action) = 0;
|
virtual void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitime_t timeUs, action_s action) = 0;
|
||||||
virtual void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) = 0;
|
virtual void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) = 0;
|
||||||
virtual void cancel(scheduling_s* scheduling) = 0;
|
virtual void cancel(scheduling_s* scheduling) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@ bool printSchedulerDebug = true;
|
||||||
#if EFI_SIGNAL_EXECUTOR_SLEEP
|
#if EFI_SIGNAL_EXECUTOR_SLEEP
|
||||||
|
|
||||||
void SleepExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) {
|
void SleepExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) {
|
||||||
scheduleForLater(scheduling, timeUs - getTimeNowUs(), action);
|
scheduleForLater(msg, scheduling, timeUs - getTimeNowUs(), action);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SleepExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t timeNt, action_s action) {
|
void SleepExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t timeNt, action_s action) {
|
||||||
|
@ -87,7 +87,7 @@ static void doScheduleForLater(scheduling_s *scheduling, int delayUs, action_s a
|
||||||
chVTSetI(&scheduling->timer, delaySt, (vtfunc_t)timerCallback, scheduling);
|
chVTSetI(&scheduling->timer, delaySt, (vtfunc_t)timerCallback, scheduling);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SleepExecutor::scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) {
|
void SleepExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) {
|
||||||
doScheduleForLater(scheduling, delayUs, action);
|
doScheduleForLater(scheduling, delayUs, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,6 @@ class SleepExecutor : public ExecutorInterface {
|
||||||
public:
|
public:
|
||||||
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
||||||
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||||
void cancel(scheduling_s* s) override;
|
void cancel(scheduling_s* s) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,8 +45,8 @@ SingleTimerExecutor::SingleTimerExecutor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SingleTimerExecutor::scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) {
|
void SingleTimerExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) {
|
||||||
scheduleByTimestamp("scheduleForLater", scheduling, getTimeNowUs() + delayUs, action);
|
scheduleByTimestamp(msg, scheduling, getTimeNowUs() + delayUs, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,7 +15,7 @@ public:
|
||||||
SingleTimerExecutor();
|
SingleTimerExecutor();
|
||||||
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
||||||
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitime_t timeNt, action_s action) override;
|
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitime_t timeNt, action_s action) override;
|
||||||
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||||
void cancel(scheduling_s* scheduling) override;
|
void cancel(scheduling_s* scheduling) override;
|
||||||
|
|
||||||
void onTimerCallback();
|
void onTimerCallback();
|
||||||
|
|
|
@ -132,7 +132,7 @@ static void watchDogBuddyCallback(void*) {
|
||||||
* watchdog happy by ensuring that we have scheduler activity even in case of very broken configuration
|
* watchdog happy by ensuring that we have scheduler activity even in case of very broken configuration
|
||||||
* without any PWM or input pins
|
* without any PWM or input pins
|
||||||
*/
|
*/
|
||||||
engine->executor.scheduleForLater(&watchDogBuddy, MS2US(1000), watchDogBuddyCallback);
|
engine->executor.scheduleForLater("watch", &watchDogBuddy, MS2US(1000), watchDogBuddyCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
static volatile bool testSchedulingHappened = false;
|
static volatile bool testSchedulingHappened = false;
|
||||||
|
@ -158,7 +158,7 @@ static void validateHardwareTimer() {
|
||||||
testSchedulingStart = currentTimeMillis();
|
testSchedulingStart = currentTimeMillis();
|
||||||
|
|
||||||
// to save RAM let's use 'watchDogBuddy' here once before we enable watchdog
|
// to save RAM let's use 'watchDogBuddy' here once before we enable watchdog
|
||||||
engine->executor.scheduleForLater(&watchDogBuddy, MS2US(TEST_CALLBACK_DELAY), timerValidationCallback);
|
engine->executor.scheduleForLater("hw-validate", &watchDogBuddy, MS2US(TEST_CALLBACK_DELAY), timerValidationCallback);
|
||||||
|
|
||||||
chThdSleepMilliseconds(TEST_CALLBACK_DELAY + 2);
|
chThdSleepMilliseconds(TEST_CALLBACK_DELAY + 2);
|
||||||
if (!testSchedulingHappened) {
|
if (!testSchedulingHappened) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ static msg_t seThread(void *arg) {
|
||||||
|
|
||||||
float durationMs = 0 + position * 0.02f;
|
float durationMs = 0 + position * 0.02f;
|
||||||
|
|
||||||
engine->executor.scheduleForLater(&servoTurnSignalOff, (int)MS2US(durationMs), { &servoTachPinLow, pin });
|
engine->executor.scheduleForLater("servo", &servoTurnSignalOff, (int)MS2US(durationMs), { &servoTachPinLow, pin });
|
||||||
|
|
||||||
|
|
||||||
chThdSleepMilliseconds(19);
|
chThdSleepMilliseconds(19);
|
||||||
|
|
|
@ -15,13 +15,13 @@ TestExecutor::~TestExecutor() {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestExecutor::scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) {
|
void TestExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) {
|
||||||
if (debugSignalExecutor) {
|
if (debugSignalExecutor) {
|
||||||
printf("scheduleTask %d\r\n", delayUs);
|
printf("scheduleTask %d\r\n", delayUs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_mockExecutor) {
|
if (m_mockExecutor) {
|
||||||
m_mockExecutor->scheduleForLater(scheduling, delayUs, action);
|
m_mockExecutor->scheduleForLater(msg, scheduling, delayUs, action);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ public:
|
||||||
|
|
||||||
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
||||||
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||||
void cancel(scheduling_s* scheduling) override;
|
void cancel(scheduling_s* scheduling) override;
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
|
@ -77,7 +77,7 @@ public:
|
||||||
|
|
||||||
MOCK_METHOD(void, scheduleByTimestamp, (const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action), (override));
|
MOCK_METHOD(void, scheduleByTimestamp, (const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action), (override));
|
||||||
MOCK_METHOD(void, scheduleByTimestampNt, (const char *msg, scheduling_s *scheduling, efitime_t timeUs, action_s action), (override));
|
MOCK_METHOD(void, scheduleByTimestampNt, (const char *msg, scheduling_s *scheduling, efitime_t timeUs, action_s action), (override));
|
||||||
MOCK_METHOD(void, scheduleForLater, (scheduling_s *scheduling, int delayUs, action_s action), (override));
|
MOCK_METHOD(void, scheduleForLater, (const char *msg, scheduling_s *scheduling, int delayUs, action_s action), (override));
|
||||||
MOCK_METHOD(void, cancel, (scheduling_s*), (override));
|
MOCK_METHOD(void, cancel, (scheduling_s*), (override));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue