The Big Refactoring of 2019: scheduler should not be global #655

This commit is contained in:
rusefi 2019-01-09 20:06:41 -05:00
parent 270af0c0ab
commit dee2402341
4 changed files with 3 additions and 8 deletions

View File

@ -6,12 +6,8 @@
*/ */
#include "signal_executor.h" #include "signal_executor.h"
#include "event_queue.h"
#include "global_execution_queue.h" #include "global_execution_queue.h"
// this global instance is used by integration tests via 'scheduleByTimestamp' global methods below
static EventQueue schedulingQueue;
bool_t debugSignalExecutor = false; bool_t debugSignalExecutor = false;
TestExecutor::TestExecutor() { TestExecutor::TestExecutor() {

View File

@ -9,6 +9,7 @@
#define GLOBAL_EXECUTION_QUEUE_H_ #define GLOBAL_EXECUTION_QUEUE_H_
#include "scheduler.h" #include "scheduler.h"
#include "event_queue.h"
class TestExecutor : public ExecutorInterface { class TestExecutor : public ExecutorInterface {
public: public:
@ -19,6 +20,8 @@ public:
int executeAll(efitime_t now); int executeAll(efitime_t now);
int size(); int size();
scheduling_s* getForUnitTest(int index); scheduling_s* getForUnitTest(int index);
private:
EventQueue schedulingQueue;
}; };
#endif /* GLOBAL_EXECUTION_QUEUE_H_ */ #endif /* GLOBAL_EXECUTION_QUEUE_H_ */

View File

@ -46,7 +46,6 @@ static void test100dutyCycle() {
TestExecutor executor; TestExecutor executor;
SimplePwm pwm("test PWM1"); SimplePwm pwm("test PWM1");
OutputPin pin; OutputPin pin;
executor.clear();
startSimplePwm(&pwm, "unit_test", startSimplePwm(&pwm, "unit_test",
&executor, &executor,
@ -74,7 +73,6 @@ static void testSwitchToNanPeriod() {
TestExecutor executor; TestExecutor executor;
SimplePwm pwm("test PWM1"); SimplePwm pwm("test PWM1");
OutputPin pin; OutputPin pin;
executor.clear();
startSimplePwm(&pwm, "unit_test", startSimplePwm(&pwm, "unit_test",
&executor, &executor,
@ -113,7 +111,6 @@ void testPwmGenerator() {
TestExecutor executor; TestExecutor executor;
SimplePwm pwm("test PWM3"); SimplePwm pwm("test PWM3");
OutputPin pin; OutputPin pin;
executor.clear();
startSimplePwm(&pwm, startSimplePwm(&pwm,
"unit_test", "unit_test",

View File

@ -14,7 +14,6 @@ void testSpeedDensity(void) {
printf("*************************************************** testSpeedDensity\r\n"); printf("*************************************************** testSpeedDensity\r\n");
EngineTestHelper eth(FORD_INLINE_6_1995); EngineTestHelper eth(FORD_INLINE_6_1995);
EXPAND_EngineTestHelper; EXPAND_EngineTestHelper;
engine->executor.clear(); // todo: there must be a better place for this
engineConfiguration->trigger.customTotalToothCount = 8; engineConfiguration->trigger.customTotalToothCount = 8;
eth.applyTriggerShape(); eth.applyTriggerShape();