From 024ef96d0df2c0ea7dc17b41260cdbbbf1d80582 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 23 Apr 2020 05:12:44 -0700 Subject: [PATCH 1/2] MAP scheduling (#1352) * map sched * format * guard test --- .../engine_cycle/map_averaging.cpp | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/firmware/controllers/engine_cycle/map_averaging.cpp b/firmware/controllers/engine_cycle/map_averaging.cpp index db5ac4ab33..e7eac6a6fe 100644 --- a/firmware/controllers/engine_cycle/map_averaging.cpp +++ b/firmware/controllers/engine_cycle/map_averaging.cpp @@ -107,8 +107,9 @@ static scheduling_s endTimer[INJECTION_PIN_COUNT][2]; */ static bool isAveraging = false; -static void startAveraging(void *arg) { - (void) arg; +static void endAveraging(void *arg); + +static void startAveraging(scheduling_s *endAveragingScheduling) { efiAssertVoid(CUSTOM_ERR_6649, getCurrentRemainingStack() > 128, "lowstck#9"); bool wasLocked = lockAnyContext(); @@ -121,6 +122,11 @@ static void startAveraging(void *arg) { } mapAveragingPin.setHigh(); + +#if ! EFI_UNIT_TEST + scheduleByAngle(endAveragingScheduling, getTimeNowNt(), ENGINE(engineState.mapAveragingDuration), + endAveraging PASS_ENGINE_PARAMETER_SUFFIX); +#endif } #if HAL_USE_ADC @@ -304,7 +310,6 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType, return; } - fixAngle(samplingEnd, "samplingEnd", CUSTOM_ERR_6563); // only if value is already prepared int structIndex = getRevolutionCounter() % 2; @@ -312,9 +317,7 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType, // we are loosing precision in case of changing RPM - the further away is the event the worse is precision // todo: schedule this based on closest trigger event, same as ignition works scheduleByAngle(&startTimer[i][structIndex], edgeTimestamp, samplingStart, - startAveraging PASS_ENGINE_PARAMETER_SUFFIX); - scheduleByAngle(&endTimer[i][structIndex], edgeTimestamp, samplingEnd, - endAveraging PASS_ENGINE_PARAMETER_SUFFIX); + { startAveraging, &endTimer[i][structIndex] } PASS_ENGINE_PARAMETER_SUFFIX); } #endif } @@ -347,11 +350,6 @@ float getMap(void) { void initMapAveraging(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { logger = sharedLogger; -// startTimer[0].name = "map start0"; -// startTimer[1].name = "map start1"; -// endTimer[0].name = "map end0"; -// endTimer[1].name = "map end1"; - #if EFI_SHAFT_POSITION_INPUT addTriggerEventListener(&mapAveragingTriggerCallback, "MAP averaging", engine); #endif /* EFI_SHAFT_POSITION_INPUT */ From 9ddef842857ff6e277d2bca480552b36ab28a76a Mon Sep 17 00:00:00 2001 From: andreika-git Date: Thu, 23 Apr 2020 15:14:03 +0300 Subject: [PATCH 2/2] Update work_in_progress.md (#1354) --- work_in_progress.md | 1 + 1 file changed, 1 insertion(+) diff --git a/work_in_progress.md b/work_in_progress.md index dbfd57b0af..ba146a5c16 100644 --- a/work_in_progress.md +++ b/work_in_progress.md @@ -2,6 +2,7 @@ Apr, 20 2020 status: * Nick and Chris are focusing on GDI progress * Matt is focusing on ETB https://github.com/rusefi/rusefi/issues/1240 https://github.com/rusefi/rusefi/issues/1336 * x number of Andreys are focusing on data gathering usability https://github.com/rusefi/rusefi/issues/1337 +* andreika is currently focusing on Hellen, SD-card/binary logging, TS plugin and online connectivity Mar, 02 2020 status: * playing with some GDI software, but now waiting for repaired MC33816 to come from Seattle