void rusEfiFunctionalTest(void) { initializeConsole(); initFakeBoard(); initStatusLoop(&engine); initDataStructures(engineConfiguration); engine.engineConfiguration = engineConfiguration; engine.engineConfiguration2 = engineConfiguration2; resetConfigurationExt(NULL, FORD_ASPIRE_1996, engineConfiguration, engineConfiguration2); initThermistors(&engine); initAlgo(engineConfiguration); initRpmCalculator(); initAnalogChart(); initTriggerEmulator(); initMainEventListener(&engine, engineConfiguration2); initTriggerCentral(&engine); startStatusThreads(&engine); startTunerStudioConnectivity(); }
void rusEfiFunctionalTest(void) { printToWin32Console("Running version:"); printToWin32Console("TODO"); initIntermediateLoggingBuffer(); initErrorHandling(); engine->setConfig(config); initializeConsole(&sharedLogger); initStatusLoop(engine); initDataStructures(PASS_ENGINE_PARAMETER_F); // todo: reduce code duplication with initEngineContoller resetConfigurationExt(NULL, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER); prepareShapes(PASS_ENGINE_PARAMETER_F); initAlgo(&sharedLogger, engineConfiguration); commonInitEngineController(&sharedLogger); initRpmCalculator(&sharedLogger, engine); #if EFI_SENSOR_CHART || defined(__DOXYGEN__) initSensorChart(); #endif /* EFI_SENSOR_CHART */ initTriggerCentral(&sharedLogger, engine); initTriggerEmulator(&sharedLogger, engine); #if EFI_MAP_AVERAGING || defined(__DOXYGEN__) initMapAveraging(&sharedLogger, engine); #endif /* EFI_MAP_AVERAGING */ initMainEventListener(&sharedLogger, engine); startStatusThreads(engine); initPeriodicEvents(PASS_ENGINE_PARAMETER_F); setTriggerEmulatorRPM(DEFAULT_SIM_RPM, engine); engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR; }
void rusEfiFunctionalTest(void) { printToConsole("Running rusEfi simulator version:"); static char versionBuffer[20]; itoa10(versionBuffer, (int)getRusEfiVersion()); printToConsole(versionBuffer); initIntermediateLoggingBuffer(); initErrorHandling(); engine->setConfig(config); initializeConsole(&sharedLogger); initStatusLoop(); initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); // todo: reduce code duplication with initEngineContoller resetConfigurationExt(NULL, FORD_ESCORT_GT PASS_ENGINE_PARAMETER_SUFFIX); prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE); initAlgo(&sharedLogger); commonInitEngineController(&sharedLogger); initRpmCalculator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); initTriggerCentral(&sharedLogger); initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); #if EFI_MAP_AVERAGING initMapAveraging(&sharedLogger, engine); #endif /* EFI_MAP_AVERAGING */ initMainEventListener(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); startStatusThreads(); runChprintfTest(); initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE); setTriggerEmulatorRPM(DEFAULT_SIM_RPM PASS_ENGINE_PARAMETER_SUFFIX); engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR; }
void runRusEfi(void) { msObjectInit(&firmwareErrorMessageStream, errorMessageBuffer, sizeof(errorMessageBuffer), 0); // that's dirty, this assignment should be nicer or in a better spot engine->engineConfiguration = engineConfiguration; engine->engineConfiguration2 = engineConfiguration2; engineConfiguration2->engineConfiguration = engineConfiguration; initErrorHandling(); /** * First data structure keeps track of which hardware I/O pins are used by whom */ initPinRepository(); /** * Next we should initialize serial port console, it's important to know what's going on */ initializeConsole(); initLogging(&logging, "main"); engine->init(); addConsoleAction("reset", scheduleReset); /** * Initialize hardware drivers */ initHardware(&logging, engine); initStatusLoop(engine); /** * Now let's initialize actual engine control logic * todo: should we initialize some? most? controllers before hardware? */ initEngineContoller(engine); #if EFI_PERF_METRICS || defined(__DOXYGEN__) initTimePerfActions(); #endif #if EFI_ENGINE_EMULATOR || defined(__DOXYGEN__) initEngineEmulator(engine); #endif startStatusThreads(engine); print("Running main loop\r\n"); main_loop_started = TRUE; /** * This loop is the closes we have to 'main loop' - but here we only publish the status. The main logic of engine * control is around main_trigger_callback */ while (TRUE) { efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "stack#1"); #if (EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE) || defined(__DOXYGEN__) // sensor state + all pending messages for our own dev console updateDevConsoleState(engine); #endif /* EFI_CLI_SUPPORT */ chThdSleepMilliseconds(boardConfiguration->consoleLoopPeriod); } }
void runRusEfi(void) { efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 512, "init s"); assertEngineReference(); initIntermediateLoggingBuffer(); initErrorHandling(); #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) /** * This is so early because we want to init logger * which would be used while finding trigger sync index * while reading configuration */ initTriggerDecoderLogger(&sharedLogger); #endif /* EFI_SHAFT_POSITION_INPUT */ /** * we need to initialize table objects before default configuration can set values */ initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); /** * First thing is reading configuration from flash memory. * In order to have complete flexibility configuration has to go before anything else. */ readConfiguration(&sharedLogger); prepareVoidConfiguration(&activeConfiguration); /** * First data structure keeps track of which hardware I/O pins are used by whom */ initPinRepository(); /** * Next we should initialize serial port console, it's important to know what's going on */ initializeConsole(&sharedLogger); engine->setConfig(config); addConsoleAction("reboot", scheduleReboot); /** * Initialize hardware drivers */ initHardware(&sharedLogger); initStatusLoop(); /** * Now let's initialize actual engine control logic * todo: should we initialize some? most? controllers before hardware? */ initEngineContoller(&sharedLogger PASS_ENGINE_PARAMETER_SIGNATURE); #if EFI_PERF_METRICS || defined(__DOXYGEN__) initTimePerfActions(&sharedLogger); #endif #if EFI_ENGINE_EMULATOR || defined(__DOXYGEN__) initEngineEmulator(&sharedLogger, engine); #endif startStatusThreads(); test557init(); rememberCurrentConfiguration(); print("Running main loop\r\n"); main_loop_started = true; /** * This loop is the closes we have to 'main loop' - but here we only publish the status. The main logic of engine * control is around main_trigger_callback */ while (true) { efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "stack#1"); #if (EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE) || defined(__DOXYGEN__) // sensor state + all pending messages for our own dev console updateDevConsoleState(); #endif /* EFI_CLI_SUPPORT */ chThdSleepMilliseconds(boardConfiguration->consoleLoopPeriod); } }