From 44cc21bcfd310cb35875ac275f775ebdafe9acb7 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 14 Sep 2014 14:10:57 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/system/SingleTimerExecutor.cpp | 4 ++-- firmware/controllers/system/SingleTimerExecutor.h | 2 +- unit_tests/main.cpp | 2 +- unit_tests/test_signal_executor.cpp | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/system/SingleTimerExecutor.cpp b/firmware/controllers/system/SingleTimerExecutor.cpp index a7403fef3a..62c79b0b06 100644 --- a/firmware/controllers/system/SingleTimerExecutor.cpp +++ b/firmware/controllers/system/SingleTimerExecutor.cpp @@ -28,7 +28,7 @@ static Executor instance; extern schfunc_t globalTimerCallback; static void executorCallback(void *arg) { - instance.execute(getTimeNowUs()); + instance.onTimerCallback(getTimeNowUs()); } Executor::Executor() { @@ -68,7 +68,7 @@ void Executor::schedule(const char *prefix, scheduling_s *scheduling, uint64_t n schedule2(prefix, scheduling, nowUs + delayUs, callback, param); } -void Executor::execute(uint64_t nowUs) { +void Executor::onTimerCallback(uint64_t nowUs) { lock(); doExecute(nowUs); unlock(); diff --git a/firmware/controllers/system/SingleTimerExecutor.h b/firmware/controllers/system/SingleTimerExecutor.h index 9a32e3ce90..1e76987633 100644 --- a/firmware/controllers/system/SingleTimerExecutor.h +++ b/firmware/controllers/system/SingleTimerExecutor.h @@ -16,7 +16,7 @@ public: Executor(); void schedule(const char *prefix, scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback, void *param); void schedule2(const char *prefix, scheduling_s *scheduling, uint64_t timeUs, schfunc_t callback, void *param); - void execute(uint64_t nowUs); + void onTimerCallback(uint64_t nowUs); private: EventQueue queue; bool reentrantLock; diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index e4487dab1a..bcbbf18f90 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -130,7 +130,7 @@ int main(void) { testFLStack(); // resizeMap(); - printf("Success 20130830\r\n"); + printf("Success 20130914\r\n"); return EXIT_SUCCESS; } diff --git a/unit_tests/test_signal_executor.cpp b/unit_tests/test_signal_executor.cpp index a93ca9982b..9f7c890541 100644 --- a/unit_tests/test_signal_executor.cpp +++ b/unit_tests/test_signal_executor.cpp @@ -29,6 +29,12 @@ void scheduleTask(const char *msg, scheduling_s *scheduling, int delayUs, schfun schedulingQueue.insertTask(scheduling, getTimeNowUs() + delayUs, callback, param); } +void scheduleTask2(const char *prefix, scheduling_s *scheduling, uint64_t time, schfunc_t callback, void *param) { + firmwareError("not implemented"); + //schedulingQueue.insertTask(scheduling, getTimeNowUs() + delayUs, callback, param); +} + + void initSignalExecutorImpl(void) { }