auto-sync
This commit is contained in:
parent
35f0b0e164
commit
d08abce615
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
static ign_Map3D_t advanceMap;
|
static ign_Map3D_t advanceMap("advance");
|
||||||
static ign_Map3D_t iatAdvanceCorrectionMap;
|
static ign_Map3D_t iatAdvanceCorrectionMap("iat corr");
|
||||||
|
|
||||||
static const float iatTimingRpmBins[IGN_LOAD_COUNT] = {880, 1260, 1640, 2020, 2400, 2780, 3000, 3380, 3760, 4140, 4520, 5000, 5700, 6500, 7200, 8000};
|
static const float iatTimingRpmBins[IGN_LOAD_COUNT] = {880, 1260, 1640, 2020, 2400, 2780, 3000, 3380, 3760, 4140, 4520, 5000, 5700, 6500, 7200, 8000};
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
EXTERN_ENGINE
|
EXTERN_ENGINE
|
||||||
;
|
;
|
||||||
|
|
||||||
static fuel_Map3D_t fuelMap;
|
static fuel_Map3D_t fuelMap("fuel");
|
||||||
static fuel_Map3D_t fuelPhaseMap;
|
static fuel_Map3D_t fuelPhaseMap("fl ph");
|
||||||
extern fuel_Map3D_t ve2Map;
|
extern fuel_Map3D_t ve2Map;
|
||||||
extern fuel_Map3D_t afrMap;
|
extern fuel_Map3D_t afrMap;
|
||||||
extern baroCorr_Map3D_t baroCorrMap;
|
extern baroCorr_Map3D_t baroCorrMap;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "error_handling.h"
|
#include "error_handling.h"
|
||||||
#include "interpolation.h"
|
#include "interpolation.h"
|
||||||
|
#include "efilib.h"
|
||||||
|
|
||||||
// 'random' value to be sure we are not treating any non-zero trash as TRUE
|
// 'random' value to be sure we are not treating any non-zero trash as TRUE
|
||||||
#define MAGIC_TRUE_VALUE 153351512
|
#define MAGIC_TRUE_VALUE 153351512
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
||||||
class Map3D {
|
class Map3D {
|
||||||
public:
|
public:
|
||||||
Map3D();
|
Map3D(const char*name);
|
||||||
void init(float table[RPM_BIN_SIZE][LOAD_BIN_SIZE], float loadBins[LOAD_BIN_SIZE], float rpmBins[RPM_BIN_SIZE]);
|
void init(float table[RPM_BIN_SIZE][LOAD_BIN_SIZE], float loadBins[LOAD_BIN_SIZE], float rpmBins[RPM_BIN_SIZE]);
|
||||||
float getValue(float x, float rpm);
|
float getValue(float x, float rpm);
|
||||||
void setAll(float value);
|
void setAll(float value);
|
||||||
|
@ -26,6 +27,7 @@ private:
|
||||||
float *loadBins;
|
float *loadBins;
|
||||||
float *rpmBins;
|
float *rpmBins;
|
||||||
int initialized;
|
int initialized;
|
||||||
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<int SIZE>
|
template<int SIZE>
|
||||||
|
@ -79,11 +81,16 @@ void Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::init(float table[RPM_BIN_SIZE][LOAD_BIN
|
||||||
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
||||||
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float x, float rpm) {
|
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float x, float rpm) {
|
||||||
efiAssert(initialized == MAGIC_TRUE_VALUE, "map not initialized", NAN);
|
efiAssert(initialized == MAGIC_TRUE_VALUE, "map not initialized", NAN);
|
||||||
|
if (cisnan(x)) {
|
||||||
|
warning(OBD_PCM_Processor_Fault, "%s: x is NaN", name);
|
||||||
|
return NAN;
|
||||||
|
}
|
||||||
return interpolate3d(x, loadBins, LOAD_BIN_SIZE, rpm, rpmBins, RPM_BIN_SIZE, pointers);
|
return interpolate3d(x, loadBins, LOAD_BIN_SIZE, rpm, rpmBins, RPM_BIN_SIZE, pointers);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
|
||||||
Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::Map3D() {
|
Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::Map3D(const char *name) {
|
||||||
|
this->name = name;
|
||||||
initialized = 0;
|
initialized = 0;
|
||||||
memset(&pointers, 0, sizeof(pointers));
|
memset(&pointers, 0, sizeof(pointers));
|
||||||
loadBins = NULL;
|
loadBins = NULL;
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
#define rpmMin 500
|
#define rpmMin 500
|
||||||
#define rpmMax 8000
|
#define rpmMax 8000
|
||||||
|
|
||||||
fuel_Map3D_t veMap;
|
fuel_Map3D_t veMap("VE");
|
||||||
fuel_Map3D_t ve2Map;
|
fuel_Map3D_t ve2Map("VE2");
|
||||||
fuel_Map3D_t afrMap;
|
fuel_Map3D_t afrMap("AFR");
|
||||||
baroCorr_Map3D_t baroCorrMap;
|
baroCorr_Map3D_t baroCorrMap("baro");
|
||||||
|
|
||||||
#define tpMin 0
|
#define tpMin 0
|
||||||
#define tpMax 100
|
#define tpMax 100
|
||||||
|
|
|
@ -275,5 +275,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20151226;
|
return 20151227;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue