auto-sync
This commit is contained in:
parent
b3c7fc0465
commit
eb28b70d90
|
@ -22,5 +22,5 @@ void setSubaru2003Wrx(engine_configuration_s *engineConfiguration) {
|
||||||
engineConfiguration->trigger.customTotalToothCount = 5;
|
engineConfiguration->trigger.customTotalToothCount = 5;
|
||||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||||
|
|
||||||
|
engineConfiguration->analogChartFrequency = 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp) {
|
||||||
#define GAS_R 0.28705
|
#define GAS_R 0.28705
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return value in seconds
|
* @return per cylinder injection time, in seconds
|
||||||
*/
|
*/
|
||||||
float sdMath(engine_configuration_s *engineConfiguration, float VE, float MAP, float AFR, float tempK) {
|
float sdMath(engine_configuration_s *engineConfiguration, float VE, float MAP, float AFR, float tempK) {
|
||||||
if (MAP < 0.001 || cisnan(MAP)) {
|
if (MAP < 0.001 || cisnan(MAP)) {
|
||||||
|
@ -54,12 +54,13 @@ float sdMath(engine_configuration_s *engineConfiguration, float VE, float MAP, f
|
||||||
}
|
}
|
||||||
|
|
||||||
float injectorFlowRate = cc_minute_to_gramm_second(engineConfiguration->injector.flow);
|
float injectorFlowRate = cc_minute_to_gramm_second(engineConfiguration->injector.flow);
|
||||||
|
// todo: pre-calculate cylinder displacement to save one division
|
||||||
float Vol = engineConfiguration->specs.displacement / engineConfiguration->cylindersCount;
|
float Vol = engineConfiguration->specs.displacement / engineConfiguration->cylindersCount;
|
||||||
return (Vol * VE * MAP) / (AFR * injectorFlowRate * GAS_R * tempK);
|
return (Vol * VE * MAP) / (AFR * injectorFlowRate * GAS_R * tempK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return value in Milliseconds
|
* @return per cylinder injection time, in Milliseconds
|
||||||
*/
|
*/
|
||||||
float getSpeedDensityFuel(Engine *engine, int rpm) {
|
float getSpeedDensityFuel(Engine *engine, int rpm) {
|
||||||
//int rpm = engine->rpmCalculator->rpm();
|
//int rpm = engine->rpmCalculator->rpm();
|
||||||
|
|
|
@ -26,13 +26,24 @@ void acAddData(float angle, float value) {
|
||||||
return; // this is possible because of initialization sequence
|
return; // this is possible because of initialization sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engineConfiguration->analogChartFrequency < 1) {
|
if (engineConfiguration->analogChartFrequency < 2) {
|
||||||
|
/**
|
||||||
|
* analog chart frequency cannot be 1 because of the way
|
||||||
|
* data flush is implemented, see below
|
||||||
|
*/
|
||||||
//todofirmwareError()
|
//todofirmwareError()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRevolutionCounter() % engineConfiguration->analogChartFrequency != 0) {
|
if (getRevolutionCounter() % engineConfiguration->analogChartFrequency != 0) {
|
||||||
|
/**
|
||||||
|
* We are here if we do NOT need to add an event to the analog chart
|
||||||
|
*/
|
||||||
if (pendingData) {
|
if (pendingData) {
|
||||||
|
/**
|
||||||
|
* We are here if that's the first time we do not need to add
|
||||||
|
* data after we have added some data - meaning it's time to flush
|
||||||
|
*/
|
||||||
// message terminator
|
// message terminator
|
||||||
appendPrintf(&logging, DELIMETER);
|
appendPrintf(&logging, DELIMETER);
|
||||||
// output pending data
|
// output pending data
|
||||||
|
|
|
@ -492,6 +492,7 @@ void testTriggerDecoder(void) {
|
||||||
test1995FordInline6TriggerDecoder();
|
test1995FordInline6TriggerDecoder();
|
||||||
testMazdaMianaNbDecoder();
|
testMazdaMianaNbDecoder();
|
||||||
testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0);
|
testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0);
|
||||||
|
testTriggerDecoder2("testSubary", SUBARU_2003_WRX, 0, 0.4000, 0.0);
|
||||||
|
|
||||||
testTriggerDecoder2("testFordEscortGt", FORD_ESCORT_GT, 0, 0.8096, 0.3844);
|
testTriggerDecoder2("testFordEscortGt", FORD_ESCORT_GT, 0, 0.8096, 0.3844);
|
||||||
testTriggerDecoder2("testMiniCooper", MINI_COOPER_R50, 121, 0.5222, 0.4959);
|
testTriggerDecoder2("testMiniCooper", MINI_COOPER_R50, 121, 0.5222, 0.4959);
|
||||||
|
|
Loading…
Reference in New Issue