mirror of https://github.com/FOME-Tech/fome-fw.git
add mock airmass mode
This commit is contained in:
parent
0a30f1d6f2
commit
bd31eea73a
|
@ -735,6 +735,8 @@ case LM_SPEED_DENSITY:
|
||||||
return "LM_SPEED_DENSITY";
|
return "LM_SPEED_DENSITY";
|
||||||
case LM_ALPHA_N_2:
|
case LM_ALPHA_N_2:
|
||||||
return "LM_ALPHA_N_2";
|
return "LM_ALPHA_N_2";
|
||||||
|
case LM_MOCK:
|
||||||
|
return "LM_MOCK";
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "accel_enrichment.h"
|
#include "accel_enrichment.h"
|
||||||
#include "trigger_central.h"
|
#include "trigger_central.h"
|
||||||
#include "local_version_holder.h"
|
#include "local_version_holder.h"
|
||||||
|
#include "airmass.h"
|
||||||
|
|
||||||
#if EFI_SIGNAL_EXECUTOR_ONE_TIMER
|
#if EFI_SIGNAL_EXECUTOR_ONE_TIMER
|
||||||
// PROD real firmware uses this implementation
|
// PROD real firmware uses this implementation
|
||||||
|
@ -334,6 +335,10 @@ public:
|
||||||
void knockLogic(float knockVolts DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void knockLogic(float knockVolts DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void printKnockState(void);
|
void printKnockState(void);
|
||||||
|
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
|
AirmassModelBase* mockAirmassModel = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* By the way:
|
* By the way:
|
||||||
|
|
|
@ -179,6 +179,9 @@ AirmassModelBase* getAirmassModel(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
case LM_SPEED_DENSITY: return &sdAirmass;
|
case LM_SPEED_DENSITY: return &sdAirmass;
|
||||||
case LM_REAL_MAF: return &mafAirmass;
|
case LM_REAL_MAF: return &mafAirmass;
|
||||||
case LM_ALPHA_N_2: return &alphaNAirmass;
|
case LM_ALPHA_N_2: return &alphaNAirmass;
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
|
case LM_MOCK: return engine->mockAirmassModel;
|
||||||
|
#endif
|
||||||
default: return nullptr;
|
default: return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,6 +446,9 @@ typedef enum {
|
||||||
// todo: rename after LM_ALPHA_N is removed
|
// todo: rename after LM_ALPHA_N is removed
|
||||||
LM_ALPHA_N_2 = 5,
|
LM_ALPHA_N_2 = 5,
|
||||||
|
|
||||||
|
// This mode is for unit testing only, so that tests don't have to rely on a particular real airmass mode
|
||||||
|
LM_MOCK = 100,
|
||||||
|
|
||||||
Force_4_bytes_size_engine_load_mode = ENUM_32_BITS,
|
Force_4_bytes_size_engine_load_mode = ENUM_32_BITS,
|
||||||
} engine_load_mode_e;
|
} engine_load_mode_e;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue