From 7fe72ed4a837b075c71f1016b84468cf1d1469df Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 14 May 2015 23:10:04 -0400 Subject: [PATCH] auto-sync --- firmware/controllers/algo/advance_map.cpp | 4 ++-- firmware/controllers/algo/advance_map.h | 2 +- firmware/controllers/system/event_queue.cpp | 10 +++++----- firmware/controllers/trigger/trigger_central.cpp | 2 +- .../com/rusefi/ui/util/DefaultExceptionHandler.java | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index abcbf51153..d76eeb7766 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -70,8 +70,8 @@ float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) { return result; } -float getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) { - float angle; +angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) { + angle_t angle; if (isCrankingR(rpm)) { angle = engineConfiguration->crankingTimingAngle; } else { diff --git a/firmware/controllers/algo/advance_map.h b/firmware/controllers/algo/advance_map.h index fd257ed4de..47bec86fc4 100644 --- a/firmware/controllers/algo/advance_map.h +++ b/firmware/controllers/algo/advance_map.h @@ -10,7 +10,7 @@ #include "engine.h" -float getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S); +angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S); void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_F); void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F); diff --git a/firmware/controllers/system/event_queue.cpp b/firmware/controllers/system/event_queue.cpp index 92c93a27e8..07de3aa9d1 100644 --- a/firmware/controllers/system/event_queue.cpp +++ b/firmware/controllers/system/event_queue.cpp @@ -103,7 +103,7 @@ uint64_t EventQueue::getNextEventTime(uint64_t nowX) { return EMPTY_QUEUE; } -// static scheduling_s * longScheduling; +static scheduling_s * longScheduling; uint32_t maxEventQueueTime = 0; uint32_t lastEventQueueTime; @@ -158,10 +158,10 @@ int EventQueue::executeAll(uint64_t now) { lastEventQueueTime = GET_TIMESTAMP() - before; if (lastEventQueueTime > maxEventQueueTime) maxEventQueueTime = lastEventQueueTime; -// if (cost > 2000) { -// longScheduling = current; -// cost++; -// } + if (lastEventQueueTime > 2000) { + longScheduling = current; + lastEventQueueTime++; + } } return executionCounter; } diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 49c1bd483e..70779cf36a 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -295,7 +295,7 @@ void triggerInfo(Engine *engine) { scheduleMsg(logger, "zeroTestTime=%d maxHowFarOff=%d", engine->m.zeroTestTime, maxHowFarOff); maxHowFarOff = 0; - scheduleMsg(logger, "advanceLookupTime=%d t=%d fuelCalcTime=%d", + scheduleMsg(logger, "advanceLookupTime=%d now=%d fuelCalcTime=%d", engine->m.advanceLookupTime, *cyccnt, engine->m.fuelCalcTime); diff --git a/java_console/ui/src/com/rusefi/ui/util/DefaultExceptionHandler.java b/java_console/ui/src/com/rusefi/ui/util/DefaultExceptionHandler.java index 4863c2d09a..88f188a65d 100644 --- a/java_console/ui/src/com/rusefi/ui/util/DefaultExceptionHandler.java +++ b/java_console/ui/src/com/rusefi/ui/util/DefaultExceptionHandler.java @@ -20,6 +20,8 @@ public class DefaultExceptionHandler implements Thread.UncaughtExceptionHandler } public static void handleException(Throwable e) { + if (e == null) + throw new NullPointerException("Throwable e"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); e.printStackTrace(ps);