auto-sync

This commit is contained in:
rusEfi 2014-11-24 19:03:21 -06:00
parent 0232c7cffe
commit 3b34c95c01
3 changed files with 5 additions and 3 deletions

View File

@ -54,6 +54,7 @@ public:
*/
bool isCylinderCleanupMode;
uint32_t beforeIgnitionMath;
uint32_t ignitionMathTime;

View File

@ -328,7 +328,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng
if (eventIndex == 0) {
if (localVersion.isOld())
prepareOutputSignals(engine);
uint32_t beforeIgnitionMath = GET_TIMESTAMP();
engine->beforeIgnitionMath = GET_TIMESTAMP();
/**
* TODO: warning. there is a bit of a hack here, todo: improve.
@ -343,6 +343,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng
* todo: one day we can control cylinders individually
*/
float dwellMs = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER);
if (cisnan(dwellMs) || dwellMs < 0) {
firmwareError("invalid dwell: %f at %d", dwellMs, rpm);
return;
@ -370,7 +371,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex, Eng
initializeIgnitionActions(-advance, dwellAngle,
&engine->engineConfiguration2->ignitionEvents[revolutionIndex] PASS_ENGINE_PARAMETER);
engine->ignitionMathTime = GET_TIMESTAMP() - beforeIgnitionMath;
engine->ignitionMathTime = GET_TIMESTAMP() - engine->beforeIgnitionMath;
}
triggerEventsQueue.executeAll(getCrankEventCounter());

View File

@ -258,7 +258,7 @@ void firmwareError(const char *fmt, ...) {
static char UNUSED_RAM_SIZE[10000];
static char UNUSED_CCM_SIZE[15000] CCM_OPTIONAL;
static char UNUSED_CCM_SIZE[11000] CCM_OPTIONAL;
int getRusEfiVersion(void) {
if (UNUSED_RAM_SIZE == 0)