auto-sync

This commit is contained in:
rusEfi 2015-02-08 18:04:13 -06:00
parent b3c7fc0465
commit eb28b70d90
4 changed files with 17 additions and 4 deletions

View File

@ -22,5 +22,5 @@ void setSubaru2003Wrx(engine_configuration_s *engineConfiguration) {
engineConfiguration->trigger.customTotalToothCount = 5;
engineConfiguration->trigger.customSkippedToothCount = 1;
engineConfiguration->analogChartFrequency = 2;
}

View File

@ -45,7 +45,7 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp) {
#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) {
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);
// todo: pre-calculate cylinder displacement to save one division
float Vol = engineConfiguration->specs.displacement / engineConfiguration->cylindersCount;
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) {
//int rpm = engine->rpmCalculator->rpm();

View File

@ -26,13 +26,24 @@ void acAddData(float angle, float value) {
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()
return;
}
if (getRevolutionCounter() % engineConfiguration->analogChartFrequency != 0) {
/**
* We are here if we do NOT need to add an event to the analog chart
*/
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
appendPrintf(&logging, DELIMETER);
// output pending data

View File

@ -492,6 +492,7 @@ void testTriggerDecoder(void) {
test1995FordInline6TriggerDecoder();
testMazdaMianaNbDecoder();
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("testMiniCooper", MINI_COOPER_R50, 121, 0.5222, 0.4959);