2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file engine_emulator.cpp
|
|
|
|
* @brief Entry point for all the emulation and analysis code
|
|
|
|
*
|
2019-04-14 10:21:03 -07:00
|
|
|
* there is a chance that 90% of the code here is dead
|
|
|
|
*
|
2015-07-10 06:01:56 -07:00
|
|
|
* @date Mar 15, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2018-09-16 19:26:57 -07:00
|
|
|
#include "global.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "engine_emulator.h"
|
|
|
|
|
|
|
|
#include "advance_map.h"
|
|
|
|
#include "fuel_math.h"
|
|
|
|
|
|
|
|
#include "status_loop.h"
|
2019-12-03 22:11:10 -08:00
|
|
|
#include "logic_analyzer.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "pin_repository.h"
|
|
|
|
#include "pwm_generator_logic.h"
|
|
|
|
|
|
|
|
#include "poten.h"
|
2020-04-24 11:00:06 -07:00
|
|
|
#include "trigger_emulator_algo.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-04-21 11:03:08 -07:00
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
2019-01-04 21:57:09 -08:00
|
|
|
void initEngineEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
2015-07-10 06:01:56 -07:00
|
|
|
if (hasFirmwareError())
|
|
|
|
return;
|
|
|
|
|
2019-04-14 10:21:03 -07:00
|
|
|
#if EFI_POTENTIOMETER && HAL_USE_SPI
|
2019-01-09 19:57:33 -08:00
|
|
|
initPotentiometers(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-04-14 10:21:03 -07:00
|
|
|
#endif /* EFI_POTENTIOMETER && HAL_USE_SPI*/
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
initTriggerEmulator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|