diff --git a/firmware/.cproject b/firmware/.cproject
index 921a97abbe..49bd074758 100644
--- a/firmware/.cproject
+++ b/firmware/.cproject
@@ -98,7 +98,7 @@
-
+
@@ -154,7 +154,7 @@
-
+
diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp
index a175c8d7a9..1035d87d0d 100644
--- a/firmware/config/engines/mazda_miata_1_6.cpp
+++ b/firmware/config/engines/mazda_miata_1_6.cpp
@@ -155,6 +155,7 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->injectionPins[3] = GPIO_UNASSIGNED;
engineConfiguration->injectionMode = IM_BATCH;
+ engineConfiguration->warningPeriod = 0;
}
diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h
index 637cc1ad1a..81ab2543ad 100644
--- a/firmware/controllers/algo/obd_error_codes.h
+++ b/firmware/controllers/algo/obd_error_codes.h
@@ -1715,7 +1715,7 @@ typedef enum {
CUSTOM_OBD_44 = 6044,
CUSTOM_OBD_45 = 6045,
CUSTOM_OBD_SKIPPED_FUEL = 6046,
- CUSTOM_OBD_47 = 6047,
+ CUSTOM_OBD_SCH_REUSE = 6047,
CUSTOM_OBD_48 = 6048,
CUSTOM_OBD_49 = 6049,
diff --git a/firmware/controllers/system/SingleTimerExecutor.cpp b/firmware/controllers/system/SingleTimerExecutor.cpp
index edfcad0096..626008a1df 100644
--- a/firmware/controllers/system/SingleTimerExecutor.cpp
+++ b/firmware/controllers/system/SingleTimerExecutor.cpp
@@ -59,7 +59,7 @@ Executor::Executor() {
queue.setLateDelay(US2NT(100));
}
-void Executor::scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback,
+void Executor::scheduleByTime(const bool monitorReuse, scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback,
void *param) {
// if (delayUs < 0) {
// firmwareError("Negative delayUs %s: %d", prefix, delayUs);
@@ -83,11 +83,6 @@ void Executor::scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schf
}
}
-void Executor::schedule(scheduling_s *scheduling, efitime_t nowUs, int delayUs, schfunc_t callback,
- void *param) {
- scheduleByTime(scheduling, nowUs + delayUs, callback, param);
-}
-
void Executor::onTimerCallback() {
lockAnyContext();
doExecute();
@@ -157,12 +152,12 @@ void Executor::scheduleTimerCallback() {
*/
void scheduleTask(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param) {
// scheduling->name = prefix;
- instance.scheduleByTime(scheduling, getTimeNowUs() + delayUs, callback, param);
+ instance.scheduleByTime(monitorReuse, scheduling, getTimeNowUs() + delayUs, callback, param);
}
-void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
+void scheduleByTime(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
// scheduling->name = prefix;
- instance.scheduleByTime(scheduling, time, callback, param);
+ instance.scheduleByTime(monitorReuse, scheduling, time, callback, param);
}
void initSignalExecutorImpl(void) {
diff --git a/firmware/controllers/system/SingleTimerExecutor.h b/firmware/controllers/system/SingleTimerExecutor.h
index 8357c2d96a..8a25c1e8a5 100644
--- a/firmware/controllers/system/SingleTimerExecutor.h
+++ b/firmware/controllers/system/SingleTimerExecutor.h
@@ -14,8 +14,7 @@
class Executor {
public:
Executor();
- void schedule(scheduling_s *scheduling, efitime_t nowUs, int delayUs, schfunc_t callback, void *param);
- void scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param);
+ void scheduleByTime(const bool monitorReuse, scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param);
void onTimerCallback();
private:
EventQueue queue;
diff --git a/firmware/controllers/system/event_queue.cpp b/firmware/controllers/system/event_queue.cpp
index ca4ffac32e..1a873140bd 100644
--- a/firmware/controllers/system/event_queue.cpp
+++ b/firmware/controllers/system/event_queue.cpp
@@ -35,10 +35,13 @@ bool EventQueue::checkIfPending(scheduling_s *scheduling) {
return assertNotInList(head, scheduling);
}
+bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param) {
+ return insertTask(false, "*", scheduling, timeX, callback, param);
+}
/**
* @return true if inserted into the head of the list
*/
-bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param) {
+bool EventQueue::insertTask(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param) {
#if EFI_UNIT_TEST
assertListIsSorted();
#endif /* EFI_UNIT_TEST */
@@ -47,6 +50,10 @@ bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t
// please note that simulator does not use this code at all - simulator uses signal_executor_sleep
if (scheduling->isScheduled) {
+ if (monitorReuse) {
+ warning(CUSTOM_OBD_SCH_REUSE, "reuse [%s]", prefix);
+ }
+
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
printf("Already scheduled was %d\r\n", (int)scheduling->momentX);
printf("Already scheduled now %d\r\n", (int)timeX);
diff --git a/firmware/controllers/system/event_queue.h b/firmware/controllers/system/event_queue.h
index 7759edacc5..7b3637a691 100644
--- a/firmware/controllers/system/event_queue.h
+++ b/firmware/controllers/system/event_queue.h
@@ -52,6 +52,7 @@ public:
/**
* O(size) - linear search in sorted linked list
*/
+ bool insertTask(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param);
bool insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param);
int executeAll(efitime_t now);
diff --git a/firmware/controllers/system/pwm_generator_logic.cpp b/firmware/controllers/system/pwm_generator_logic.cpp
index dc11999ed4..95fffd809b 100644
--- a/firmware/controllers/system/pwm_generator_logic.cpp
+++ b/firmware/controllers/system/pwm_generator_logic.cpp
@@ -155,7 +155,7 @@ static void timerCallback(PwmConfig *state) {
efiAssertVoid(state->dbgNestingLevel < 25, "PWM nesting issue");
efitimeus_t switchTimeUs = togglePwmState(state);
- scheduleByTime("pwm", &state->scheduling, switchTimeUs, (schfunc_t) timerCallback, state);
+ scheduleByTime(false, "pwm", &state->scheduling, switchTimeUs, (schfunc_t) timerCallback, state);
state->dbgNestingLevel--;
}
diff --git a/firmware/controllers/system/scheduler.h b/firmware/controllers/system/scheduler.h
index 07176f2968..d6b71aa6c4 100644
--- a/firmware/controllers/system/scheduler.h
+++ b/firmware/controllers/system/scheduler.h
@@ -27,6 +27,6 @@ public:
};
void scheduleTask(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param);
-void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param);
+void scheduleByTime(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param);
#endif /* SCHEDULER_H_ */
diff --git a/firmware/controllers/system/signal_executor_sleep.cpp b/firmware/controllers/system/signal_executor_sleep.cpp
index 35369e3bdf..0fad1d225c 100644
--- a/firmware/controllers/system/signal_executor_sleep.cpp
+++ b/firmware/controllers/system/signal_executor_sleep.cpp
@@ -34,8 +34,8 @@
#if EFI_SIGNAL_EXECUTOR_SLEEP || defined(__DOXYGEN__)
-void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
- scheduleTask(true, prefix, scheduling, time - getTimeNowUs(), callback, param);
+void scheduleByTime(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param) {
+ scheduleTask(monitorReuse, prefix, scheduling, time - getTimeNowUs(), callback, param);
}
static void timerCallback(scheduling_s *scheduling) {
diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp
index 749f172496..fdc65faf0f 100644
--- a/firmware/controllers/trigger/main_trigger_callback.cpp
+++ b/firmware/controllers/trigger/main_trigger_callback.cpp
@@ -174,7 +174,7 @@ static void seScheduleByTime(const char *prefix, scheduling_s *scheduling, efiti
printf("seScheduleByTime %s %s %d sch=%d\r\n", direction, param->name, (int)time, (int)scheduling);
#endif /* FUEL_MATH_EXTREME_LOGGING || EFI_UNIT_TEST */
- scheduleByTime(prefix, scheduling, time, callback, pair);
+ scheduleByTime(true, prefix, scheduling, time, callback, pair);
}
static void scheduleFuelInjection(int rpm, int injEventIndex, OutputSignal *signal, efitimeus_t nowUs, floatus_t delayUs, floatus_t durationUs, InjectorOutputPin *output DECLARE_ENGINE_PARAMETER_S) {
diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp
index 00d0624350..176250285c 100644
--- a/firmware/rusefi.cpp
+++ b/firmware/rusefi.cpp
@@ -293,5 +293,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
- return 20161001;
+ return 20161002;
}
diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java
index dd42680ba6..8e8d2c2a2e 100644
--- a/java_console/models/src/com/rusefi/config/Fields.java
+++ b/java_console/models/src/com/rusefi/config/Fields.java
@@ -1,6 +1,6 @@
package com.rusefi.config;
-// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Sep 17 18:26:30 EDT 2016
+// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Oct 02 13:12:05 EDT 2016
public class Fields {
public static final int LE_COMMAND_LENGTH = 200;
public static final int FSIO_ADC_COUNT = 4;
@@ -19,7 +19,6 @@ public class Fields {
public static final int INJECTION_PIN_COUNT = 12;
public static final int IGNITION_PIN_COUNT = 12;
public static final int EGT_CHANNEL_COUNT = 8;
- public static final int JOYSTICK_PIN_COUNT = 5;
public static final int DIGIPOT_COUNT = 4;
public static final int HW_MAX_ADC_INDEX = 17;
public static final int TRIGGER_SIMULATOR_PIN_COUNT = 3;
@@ -508,11 +507,7 @@ public class Fields {
public static final int gpioPinModes14_offset = 1184;
public static final int gpioPinModes15_offset = 1188;
public static final int gpioPinModes16_offset = 1192;
- public static final int joystickPins1_offset = 1196;
- public static final int joystickPins2_offset = 1200;
- public static final int joystickPins3_offset = 1204;
- public static final int joystickPins4_offset = 1208;
- public static final int joystickPins5_offset = 1212;
+ public static final int unusedJoy_offset = 1196;
public static final int triggerErrorPin_offset = 1216;
public static final int triggerErrorPinMode_offset = 1220;
public static final int acRelayPin_offset = 1224;
@@ -1261,11 +1256,6 @@ public class Fields {
public static final Field GPIOPINMODES14 = Field.create("GPIOPINMODES14", 1184, FieldType.INT, pin_output_mode_e);
public static final Field GPIOPINMODES15 = Field.create("GPIOPINMODES15", 1188, FieldType.INT, pin_output_mode_e);
public static final Field GPIOPINMODES16 = Field.create("GPIOPINMODES16", 1192, FieldType.INT, pin_output_mode_e);
- public static final Field JOYSTICKPINS1 = Field.create("JOYSTICKPINS1", 1196, FieldType.INT, brain_pin_e);
- public static final Field JOYSTICKPINS2 = Field.create("JOYSTICKPINS2", 1200, FieldType.INT, brain_pin_e);
- public static final Field JOYSTICKPINS3 = Field.create("JOYSTICKPINS3", 1204, FieldType.INT, brain_pin_e);
- public static final Field JOYSTICKPINS4 = Field.create("JOYSTICKPINS4", 1208, FieldType.INT, brain_pin_e);
- public static final Field JOYSTICKPINS5 = Field.create("JOYSTICKPINS5", 1212, FieldType.INT, brain_pin_e);
public static final Field TRIGGERERRORPIN = Field.create("TRIGGERERRORPIN", 1216, FieldType.INT, brain_pin_e);
public static final Field TRIGGERERRORPINMODE = Field.create("TRIGGERERRORPINMODE", 1220, FieldType.INT, pin_output_mode_e);
public static final Field ACRELAYPIN = Field.create("ACRELAYPIN", 1224, FieldType.INT, brain_pin_e);
diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java
index 0583b621e6..11d48bd638 100644
--- a/java_console/ui/src/com/rusefi/Launcher.java
+++ b/java_console/ui/src/com/rusefi/Launcher.java
@@ -38,7 +38,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
- public static final int CONSOLE_VERSION = 20160913;
+ public static final int CONSOLE_VERSION = 20161002;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";
diff --git a/unit_tests/test_signal_executor.cpp b/unit_tests/test_signal_executor.cpp
index 5910f7da30..de8de4d228 100644
--- a/unit_tests/test_signal_executor.cpp
+++ b/unit_tests/test_signal_executor.cpp
@@ -23,15 +23,15 @@ void scheduleTask(const bool monitorReuse, const char *msg, scheduling_s *schedu
if (debugSignalExecutor) {
printf("scheduleTask %d\r\n", delayUs);
}
- scheduleByTime(msg, scheduling, getTimeNowUs() + delayUs, callback, param);
+ scheduleByTime(monitorReuse, msg, scheduling, getTimeNowUs() + delayUs, callback, param);
}
-void scheduleByTime(const char *prefix, scheduling_s *scheduling,
+void scheduleByTime(const bool monitorReuse, const char *prefix, scheduling_s *scheduling,
efitimeus_t time, schfunc_t callback, void *param) {
if (debugSignalExecutor) {
printf("scheduleByTime %d\r\n", time);
}
- schedulingQueue.insertTask(scheduling, time, callback, param);
+ schedulingQueue.insertTask(monitorReuse, prefix, scheduling, time, callback, param);
}
void initSignalExecutorImpl(void) {