mirror of https://github.com/FOME-Tech/fome-fw.git
Ford SENT ETB bench test in NJ #4745
This commit is contained in:
parent
f9e586074a
commit
4418a08e4d
|
@ -28,6 +28,8 @@ void setDefaultBaseEngine() {
|
|||
|
||||
engineConfiguration->compressionRatio = 9;
|
||||
|
||||
engineConfiguration->sentErrorRate = 0.03; // 3% error rate
|
||||
|
||||
engineConfiguration->turbochargerFilter = 0.01f;
|
||||
|
||||
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;
|
||||
|
|
|
@ -507,6 +507,8 @@ uint8_t sent_channel::crc6(uint32_t data)
|
|||
|
||||
static sent_channel channels[SENT_CHANNELS_NUM];
|
||||
|
||||
static float valueErrorRate = -1;
|
||||
|
||||
void sent_channel::Info(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -520,6 +522,7 @@ void sent_channel::Info(void)
|
|||
if (GetSignals(&stat, &sig0, &sig1) == 0) {
|
||||
efiPrintf("Last valid fast msg Status 0x%01x Sig0 0x%03x Sig1 0x%03x", stat, sig0, sig1);
|
||||
}
|
||||
efiPrintf("valueErrorRate %f", valueErrorRate);
|
||||
|
||||
if (scMsgFlags) {
|
||||
efiPrintf("Slow channels:");
|
||||
|
@ -608,9 +611,9 @@ float getSentValue(size_t index) {
|
|||
if (ch.GetSignals(NULL, &sig0, &sig1) == 0) {
|
||||
float maxValue = 0xfff;
|
||||
|
||||
float errorRate = 1.0 - (sig0 + sig1) / maxValue;
|
||||
valueErrorRate = 1.0 - (sig0 + sig1) / maxValue;
|
||||
|
||||
if (absF(errorRate) < engineConfiguration->sentErrorRate) {
|
||||
if (absF(valueErrorRate) <= engineConfiguration->sentErrorRate) {
|
||||
/* scale to 0.0 .. 1.0 */
|
||||
return sig1 / maxValue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue