refactoring

This commit is contained in:
rusefi 2017-05-25 23:23:03 -04:00
parent a29811162b
commit ef066786c1
2 changed files with 4 additions and 3 deletions

View File

@ -178,13 +178,14 @@ static void mapAveragingCallback(trigger_event_e ckpEventType,
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
// this callback is invoked on interrupt thread
UNUSED(ckpEventType);
engine->m.beforeMapAveragingCb = GET_TIMESTAMP();
if (index != CONFIG(mapAveragingSchedulingAtIndex))
return;
engine->m.beforeMapAveragingCb = GET_TIMESTAMP();
int rpm = ENGINE(rpmCalculator.rpmValue);
if (!isValidRpm(rpm))
if (!isValidRpm(rpm)) {
return;
}
measurementsPerRevolution = measurementsPerRevolutionCounter;
measurementsPerRevolutionCounter = 0;

View File

@ -230,9 +230,9 @@ static void endIntegration(void) {
*/
static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
// this callback is invoked on interrupt thread
engine->m.beforeHipCb = GET_TIMESTAMP();
if (index != 0)
return;
engine->m.beforeHipCb = GET_TIMESTAMP();
int rpm = engine->rpmCalculator.rpmValue;
if (!isValidRpm(rpm))