auto-sync

This commit is contained in:
rusEfi 2014-12-04 14:03:27 -06:00
parent f74d3a6e09
commit 69521790fb
5 changed files with 17 additions and 10 deletions

View File

@ -59,8 +59,7 @@ public:
*/
IgnitionEventList ignitionEvents[2];
uint64_t stopEngineRequestTime;
bool_t isStopEngineRequestPending;
uint64_t stopEngineRequestTimeNt;
};
void initializeIgnitionActions(float advance, float dwellAngle,

View File

@ -578,7 +578,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType, Engine *e
engine_configuration2_s::engine_configuration2_s() {
engineConfiguration = NULL;
isStopEngineRequestPending = false;
stopEngineRequestTimeNt = 0;
}
void engine_configuration2_s::precalc() {

View File

@ -728,8 +728,7 @@ static void disableIgnition(void) {
}
static void stopEngine(Engine *engine) {
engine->engineConfiguration2->stopEngineRequestTime = getTimeNowUs();
engine->engineConfiguration2->isStopEngineRequestPending = true;
engine->engineConfiguration2->stopEngineRequestTimeNt = getTimeNowNt();
}
#if EFI_WAVE_CHART

View File

@ -38,11 +38,13 @@ extern WaveChart waveChart;
#define TOP_DEAD_CENTER_MESSAGE "r"
EXTERN_ENGINE;
EXTERN_ENGINE
;
#if EFI_PROD_CODE || EFI_SIMULATOR
static Logging logger;
EXTERN_ENGINE;
EXTERN_ENGINE
;
#endif
RpmCalculator::RpmCalculator() {
@ -63,8 +65,15 @@ RpmCalculator::RpmCalculator() {
* @return true if there was a full shaft revolution within the last second
*/
bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_F) {
engine_configuration2_s *engineConfiguration2 = engine->engineConfiguration2;
uint64_t nowNt = getTimeNowNt();
return nowNt - lastRpmEventTimeNt < US2NT(US_PER_SECOND);
if (engineConfiguration2->stopEngineRequestTimeNt != 0) {
if (nowNt - lastRpmEventTimeNt < 3 * US2NT(US_PER_SECOND_LL)) {
return false;
}
}
return nowNt - lastRpmEventTimeNt < US2NT(US_PER_SECOND_LL);
}
void RpmCalculator::setRpmValue(int value) {
@ -184,7 +193,7 @@ static char rpmBuffer[10];
*/
static void onTdcCallback(void) {
itoa10(rpmBuffer, getRpm());
addWaveChartEvent(TOP_DEAD_CENTER_MESSAGE, (char*) rpmBuffer);
addWaveChartEvent(TOP_DEAD_CENTER_MESSAGE, (char* ) rpmBuffer);
}
/**

View File

@ -265,5 +265,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20141203;
return 20141204;
}