auto-sync
This commit is contained in:
parent
efe7be54d0
commit
662f02f28a
|
@ -134,7 +134,9 @@ void scheduleOutput(OutputSignal *signal, float delayMs, float durationMs) {
|
||||||
scheduling_s * sUp = &signal->signalTimerUp[index];
|
scheduling_s * sUp = &signal->signalTimerUp[index];
|
||||||
scheduling_s * sDown = &signal->signalTimerDown[index];
|
scheduling_s * sDown = &signal->signalTimerDown[index];
|
||||||
|
|
||||||
scheduleTask("out up", sUp, (int) MS2US(delayMs), (schfunc_t) &turnPinHigh, signal->output);
|
efitimeus_t nowUs = getTimeNowUs();
|
||||||
scheduleTask("out down", sDown, (int) MS2US(delayMs) + MS2US(durationMs), (schfunc_t) &turnPinLow, signal->output);
|
|
||||||
|
scheduleByTime("out up", sUp, nowUs + (int) MS2US(delayMs), (schfunc_t) &turnPinHigh, signal->output);
|
||||||
|
scheduleByTime("out down", sDown, nowUs + (int) MS2US(delayMs + durationMs), (schfunc_t) &turnPinLow, signal->output);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ Executor::Executor() {
|
||||||
#define lock() lockAnyContext()
|
#define lock() lockAnyContext()
|
||||||
#define unlock() unlockAnyContext()
|
#define unlock() unlockAnyContext()
|
||||||
|
|
||||||
void Executor::schedule2(scheduling_s *scheduling, uint64_t timeUs, schfunc_t callback,
|
void Executor::scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback,
|
||||||
void *param) {
|
void *param) {
|
||||||
// if (delayUs < 0) {
|
// if (delayUs < 0) {
|
||||||
// firmwareError("Negative delayUs %s: %d", prefix, delayUs);
|
// firmwareError("Negative delayUs %s: %d", prefix, delayUs);
|
||||||
|
@ -78,7 +78,7 @@ void Executor::schedule2(scheduling_s *scheduling, uint64_t timeUs, schfunc_t ca
|
||||||
|
|
||||||
void Executor::schedule(scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback,
|
void Executor::schedule(scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback,
|
||||||
void *param) {
|
void *param) {
|
||||||
schedule2(scheduling, nowUs + delayUs, callback, param);
|
scheduleByTime(scheduling, nowUs + delayUs, callback, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Executor::onTimerCallback() {
|
void Executor::onTimerCallback() {
|
||||||
|
@ -141,12 +141,12 @@ void Executor::doExecute() {
|
||||||
*/
|
*/
|
||||||
void scheduleTask(const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param) {
|
void scheduleTask(const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param) {
|
||||||
scheduling->name = prefix;
|
scheduling->name = prefix;
|
||||||
instance.schedule(scheduling, getTimeNowUs(), delayUs, callback, param);
|
instance.scheduleByTime(scheduling, getTimeNowUs() + delayUs, callback, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
|
void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
|
||||||
scheduling->name = prefix;
|
scheduling->name = prefix;
|
||||||
instance.schedule2(scheduling, time, callback, param);
|
instance.scheduleByTime(scheduling, time, callback, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initSignalExecutorImpl(void) {
|
void initSignalExecutorImpl(void) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Executor {
|
||||||
public:
|
public:
|
||||||
Executor();
|
Executor();
|
||||||
void schedule(scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback, void *param);
|
void schedule(scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback, void *param);
|
||||||
void schedule2(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param);
|
void scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param);
|
||||||
void onTimerCallback();
|
void onTimerCallback();
|
||||||
private:
|
private:
|
||||||
EventQueue queue;
|
EventQueue queue;
|
||||||
|
|
Loading…
Reference in New Issue