diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp
index 58b43cac2d..beae89b9f1 100644
--- a/firmware/rusefi.cpp
+++ b/firmware/rusefi.cpp
@@ -150,7 +150,7 @@ static void scheduleReboot(void) {
}
void runRusEfi(void) {
- efiAssertVoid(getRemainingStack(chThdSelf()) > 512, "init s");
+ efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 512, "init s");
assertEngineReference(PASS_ENGINE_PARAMETER_F);
initIntermediateLoggingBuffer();
initErrorHandling();
@@ -220,7 +220,7 @@ void runRusEfi(void) {
* control is around main_trigger_callback
*/
while (true) {
- efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "stack#1");
+ efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "stack#1");
#if (EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE) || defined(__DOXYGEN__)
// sensor state + all pending messages for our own dev console
@@ -241,7 +241,7 @@ void chDbgStackOverflowPanic(thread_t *otp) {
chDbgPanic3(panicMessage, __FILE__, __LINE__);
}
-static char UNUSED_RAM_SIZE[21100];
+static char UNUSED_RAM_SIZE[20100];
static char UNUSED_CCM_SIZE[9500] CCM_OPTIONAL;
@@ -250,5 +250,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 20170326;
+ return 20170401;
}
diff --git a/java_tools/path2iar/.idea/misc.xml b/java_tools/path2iar/.idea/misc.xml
new file mode 100644
index 0000000000..2e47c90c3c
--- /dev/null
+++ b/java_tools/path2iar/.idea/misc.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/path2iar/.idea/modules.xml b/java_tools/path2iar/.idea/modules.xml
new file mode 100644
index 0000000000..09d381e4a1
--- /dev/null
+++ b/java_tools/path2iar/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/path2iar/.idea/workspace.xml b/java_tools/path2iar/.idea/workspace.xml
new file mode 100644
index 0000000000..b5866170c6
--- /dev/null
+++ b/java_tools/path2iar/.idea/workspace.xml
@@ -0,0 +1,538 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1490918477081
+
+
+ 1490918477081
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/path2iar/path2iar.iml b/java_tools/path2iar/path2iar.iml
new file mode 100644
index 0000000000..c90834f2d6
--- /dev/null
+++ b/java_tools/path2iar/path2iar.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_tools/path2iar/src/com/rusefi/Path2IAR.java b/java_tools/path2iar/src/com/rusefi/Path2IAR.java
new file mode 100644
index 0000000000..b2d0f28666
--- /dev/null
+++ b/java_tools/path2iar/src/com/rusefi/Path2IAR.java
@@ -0,0 +1,70 @@
+package com.rusefi;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+ * (c) Andrey Belomutskiy
+ * 3/30/2017.
+ */
+public class Path2IAR {
+ private static final String EOL = "\n";
+ private static final String RELATIVE = "..\\..\\firmware/ChibiOS/os";
+ private static String includes = "";
+
+ public static void main(String[] args) throws IOException {
+ String result = process(" ", new File(RELATIVE));
+
+
+ System.out.println("Result:" + EOL + EOL + EOL + EOL + EOL + EOL);
+ System.out.println(result.length());
+
+ new FileOutputStream("group.txt", false).write(result.getBytes());
+
+ System.out.println("Headers:" + EOL + EOL + EOL + EOL + EOL + EOL);
+ System.out.println(includes);
+ }
+
+ private static String process(String offset, File folder) {
+ System.out.println("Folder " + folder);
+ if (!folder.isDirectory())
+ throw new IllegalStateException("Not a directory: " + folder);
+
+
+ includes += "$PROJ_DIR$\\..\\ChibiOS\\os" + folder.getPath().substring(RELATIVE.length()) + "" + EOL;
+
+
+ String group = offset + "\n" +
+ offset + " " + folder.getName() + "\n";
+
+
+ for (String fileName : folder.list()) {
+ File file = new File(folder.getPath() + File.separator + fileName);
+ System.out.println(file);
+
+ if (file.isDirectory()) {
+ group += process(offset + " ", file);
+ continue;
+ }
+
+ if (!fileName.endsWith(".cpp") && !fileName.endsWith(".c") && !fileName.endsWith("h"))
+ continue;
+
+
+ String name = file.getPath().substring(RELATIVE.length());
+
+ group += offset + "\n" +
+ offset + " $PROJ_DIR$\\..\\ChibiOS\\os" + name + "\n" +
+ offset + "\n";
+
+ }
+
+
+
+
+ return group + offset + "" + EOL;
+
+ }
+}