refactoring & fixing build

This commit is contained in:
rusefi 2019-12-21 20:43:11 -05:00
parent 31f4d3ade9
commit 6ca549ca34
6 changed files with 20 additions and 10 deletions

View File

@ -43,6 +43,12 @@ LoggingWithStorage engineLogger("engine");
EXTERN_ENGINE EXTERN_ENGINE
; ;
#if EFI_ENGINE_SNIFFER
#include "engine_sniffer.h"
extern int waveChartUsedSize;
extern WaveChart waveChart;
#endif /* EFI_ENGINE_SNIFFER */
FsioState::FsioState() { FsioState::FsioState() {
#if EFI_ENABLE_ENGINE_WARNING #if EFI_ENABLE_ENGINE_WARNING
isEngineWarning = FALSE; isEngineWarning = FALSE;
@ -52,6 +58,14 @@ FsioState::FsioState() {
#endif #endif
} }
void Engine::resetEngineSnifferIfInTestMode() {
#if EFI_ENGINE_SNIFFER
if (isTestMode) {
waveChart.reset();
}
#endif /* EFI_ENGINE_SNIFFER */
}
void Engine::initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX) { void Engine::initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
// we have a confusing threading model so some synchronization would not hurt // we have a confusing threading model so some synchronization would not hurt

View File

@ -242,7 +242,7 @@ public:
* some areas * some areas
*/ */
bool isTestMode = false; bool isTestMode = false;
void resetEngineSnifferIfInTestMode();
/** /**
* pre-calculated offset for given sequence index within engine cycle * pre-calculated offset for given sequence index within engine cycle

View File

@ -318,10 +318,7 @@ static void setTimingMode(int value) {
void setEngineType(int value) { void setEngineType(int value) {
engineConfiguration->engineType = (engine_type_e) value; engineConfiguration->engineType = (engine_type_e) value;
resetConfigurationExt(&logger, (engine_type_e) value PASS_ENGINE_PARAMETER_SUFFIX); resetConfigurationExt(&logger, (engine_type_e) value PASS_ENGINE_PARAMETER_SUFFIX);
#if EFI_ENGINE_SNIFFER engine->resetEngineSnifferIfInTestMode();
if (engine->isTestMode)
waveChart.reset();
#endif
#if EFI_INTERNAL_FLASH #if EFI_INTERNAL_FLASH
writeToFlashNow(); writeToFlashNow();

View File

@ -107,10 +107,7 @@ void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
float rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second float rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second
triggerSignal.setFrequency(rPerSecond); triggerSignal.setFrequency(rPerSecond);
} }
#if EFI_ENGINE_SNIFFER engine->resetEngineSnifferIfInTestMode();
if (engine->isTestMode)
waveChart.reset();
#endif /* EFI_ENGINE_SNIFFER */
scheduleMsg(logger, "Emulating position sensor(s). RPM=%d", rpm); scheduleMsg(logger, "Emulating position sensor(s). RPM=%d", rpm);
} }

View File

@ -114,6 +114,8 @@ public class TestingUtils {
* also open question why do we skip TWO full charts. maybe we account for fast or slow callback period? * also open question why do we skip TWO full charts. maybe we account for fast or slow callback period?
* *
* WOW, actually we DO have CMD_RESET_ENGINE_SNIFFER already and yet things are STILL pretty slow and unreliable?! * WOW, actually we DO have CMD_RESET_ENGINE_SNIFFER already and yet things are STILL pretty slow and unreliable?!
* @see Fields#CMD_FUNCTIONAL_TEST_MODE
* @see Fields#CMD_RESET_ENGINE_SNIFFER
*/ */
getNextWaveChart(); getNextWaveChart();
getNextWaveChart(); getNextWaveChart();

View File

@ -136,7 +136,7 @@ public class RecentCommands {
add(getDisableCommand("ignition")); add(getDisableCommand("ignition"));
add(getEnableCommand("self_stimulation")); add(getEnableCommand("self_stimulation"));
add(getDisableCommand("self_stimulation"); add(getDisableCommand("self_stimulation"));
add("blipidle 80 2000"); add("blipidle 80 2000");
add("set_idle_position 50"); add("set_idle_position 50");