From 43f5fdc77d990d77a5eeb2330b11cbde386b5b3d Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:21:07 -0400 Subject: [PATCH 1/7] preparing to further git conversion --- java_tools/version2header.jar | Bin 3898 -> 4182 bytes .../src/com/rusefi/Version2Header.java | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/java_tools/version2header.jar b/java_tools/version2header.jar index 48ab55c27c07362efcca920e40aeeb6b28a5ffef..4149701115948cb3dc1474da14ac222e246ec7c6 100644 GIT binary patch literal 4182 zcmeH~c{r4N8^_01V>GtVSjyJ$j$L%(kdVPNhLJtW(HLTeVa9fBiA;_%jHpy-vLAa* zS*8?|Y}u7lp)4Ver7UCjjyihJx!(Hk{pYl9Uf-lBBTIxS z+{RW7Wr|AB@Gn?H~SCT;e=>|4Qiy~rh8ElWnZ_FU!85pE9UBCCW=(?YT}a5CqL28%2~*JinNmg z6p#YQnvqJJ?#OFxRGt%lQR*j=<{`!dGT5H>zdwwdJuQadqyA$B-(L!1APMW?^-T!; z@{c5@O2J9H001UiCH+sKJ(fuFBKRIM$GW*=iE0?U8;KNaj|e2%J-P&2%xEUN~KXcL_xrs~;SR^y2lQAqv9yc^Pnze%&zFE6NNww zzdZc*a)KE#^cP4rRrdo0DlHh#iRl<`TTVUidbGmN5C=nRZ5sWq?;&O}EC zL%c(i_fSU=n7%kqFiv}5MmP8Ho92!`e4R@?9S81ERe`&59#=3J#bYwe*r|>4lpfdg9 z;l(i13EK*)w1(+D<64&JnqjTLx=DH#>SxP5lL4(JWuEJh2}P;yy;f;XUeyJ-w|B^v z0kF!VL9>wSG%Q+2jTWeP)ju{bu|*@G`=x4_@sau4ZaLugAcciTgAm<8UeBy(mi8LN zL3@om29&G4CUOh|U{0(aH9%|J_Zm!+OdsX%pMO|gP0k$Nm$F~_)a(oV+MPk(ru7^$ z%Rg1FYnH>nJr3%#Dk9#g^)SnGDuw#80oit_NT6AYdcOej2#=YtQ8g4I>T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fg9uD|>Kzih_E<~;y_oBdGOXJ_r*`uYRlMy-bc diff --git a/java_tools/version2header/src/com/rusefi/Version2Header.java b/java_tools/version2header/src/com/rusefi/Version2Header.java index 351ffb27d4..625853d0e8 100644 --- a/java_tools/version2header/src/com/rusefi/Version2Header.java +++ b/java_tools/version2header/src/com/rusefi/Version2Header.java @@ -9,22 +9,30 @@ import java.util.Date; public class Version2Header { private static final String NL = "\n";//System.getProperty("line.separator"); - private static final String COMMAND = "svn info"; + private static final String COMMAND = "svn info "; private static final String VERSION_MARKER = "Last Changed Rev: "; private static final String HEADER_TAG = "VCS_VERSION"; public static void main(String[] args) throws IOException { - if (args.length!=1) { + if (args.length != 1 && args.length != 2) { System.out.println("Version offset value is now a mandatory parameter!"); System.exit(-1); } int versionOffsetValue = Integer.parseInt(args[0]); + String url = args.length == 2 ? args[1] : ""; System.out.println("Hi, it's " + new Date()); + if (url.isEmpty()) { + System.out.println("Looking for local version"); + } else { + System.out.println("Looking for remove version: " + url); + } + String command = COMMAND + url; + System.out.println("Working with " + NL.length() + " line ends, offset " + versionOffsetValue); Process simulatorProcess = null; try { - System.out.println("Executing [" + COMMAND + "]"); - simulatorProcess = Runtime.getRuntime().exec(COMMAND); + System.out.println("Executing [" + command + "]"); + simulatorProcess = Runtime.getRuntime().exec(command); BufferedReader stdout = new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream())); @@ -32,7 +40,7 @@ public class Version2Header { int counter = 0; String line; while ((line = stdout.readLine()) != null) { - System.out.println("from " + COMMAND + ": " + line); + System.out.println("from " + command + ": " + line); counter++; if (line.startsWith(VERSION_MARKER)) { From 1db2238d7cc690b420fae92fa62e107d6a174381 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:21:48 -0400 Subject: [PATCH 2/7] preparing to further git conversion --- firmware/update_version.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/update_version.bat b/firmware/update_version.bat index f3549d2f4b..feefec9651 100644 --- a/firmware/update_version.bat +++ b/firmware/update_version.bat @@ -1,3 +1,3 @@ rem Let's regemerate 'svnversion.h' rem TODO: handle std err - for example, in case svn needs upgrade -java -jar ../java_tools/version2header.jar 10000 \ No newline at end of file +java -jar ../java_tools/version2header.jar 10000 https://github.com/rusefi/rusefi \ No newline at end of file From 83c532c9bac0e2e1143a890e78c6b67397f0e3e5 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:41:43 -0400 Subject: [PATCH 3/7] keepking file for now --- firmware/Makefile.old | 340 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) create mode 100644 firmware/Makefile.old diff --git a/firmware/Makefile.old b/firmware/Makefile.old new file mode 100644 index 0000000000..e3e2dbc155 --- /dev/null +++ b/firmware/Makefile.old @@ -0,0 +1,340 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +PROJECT_DIR = . + +# by default EXTRA_PARAMS is empty and we create 'debug' version of the firmware with additional assertions and statistics +# for 'release' options see 'clean_compile_two_versions.bat' file + + +# Compiler options here. +ifeq ($(USE_OPT),) + #USE_OPT = $(EXTRA_PARAMS) $(RFLAGS) -Os -fomit-frame-pointer -falign-functions=16 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes + USE_OPT = -Os -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C specific options here (added to USE_OPT). +ifeq ($(USE_COPT),) + USE_COPT = -fgnu89-inline -std=gnu99 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -std=c++11 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# Linker extra options here. +ifeq ($(USE_LDOPT),) + USE_LDOPT = -Os -flto=5 +endif + +# Enable this if you want link time optimizations (LTO) +ifeq ($(USE_LTO),) + USE_LTO = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable this if you want to see the full log while compiling. +ifeq ($(USE_VERBOSE_COMPILE),) + USE_VERBOSE_COMPILE = no +endif + +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Stack size to be allocated to the Cortex-M process stack. This stack is +# the stack used by the main() thread. +ifeq ($(USE_PROCESS_STACKSIZE),) + USE_PROCESS_STACKSIZE = 0x0600 +endif + +# Stack size to the allocated to the Cortex-M main/exceptions stack. This +# stack is used for processing interrupts and exceptions. +ifeq ($(USE_EXCEPTIONS_STACKSIZE),) + USE_EXCEPTIONS_STACKSIZE = 0x1000 +endif + +# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +ifeq ($(USE_FPU),) + USE_FPU = hard +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = rusefi + +# Imported source files and paths +CHIBIOS = ChibiOS + +#PROJECT_BOARD = OLIMEX_STM32_E407 +ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407) + PROJECT_BOARD = ST_STM32F4_DISCOVERY +endif +DDEFS += -D$(PROJECT_BOARD) + +# Startup files. +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk +# HAL-OSAL files (optional). +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk +include $(CHIBIOS)/os/hal/boards/$(PROJECT_BOARD)/board.mk +include $(CHIBIOS)/os/hal/osal/rt/osal.mk +# RTOS files (optional). +include $(CHIBIOS)/os/rt/rt.mk +include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk + +include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk +include console/binary/tunerstudio.mk +include ext/ext.mk +include $(PROJECT_DIR)/hw_layer/hw_layer.mk +include $(PROJECT_DIR)/hw_layer/sensors/sensors.mk +include $(PROJECT_DIR)/hw_layer/mass_storage/mass_storage.mk +include development/development.mk +include controllers/controllers.mk + +include $(PROJECT_DIR)/util/util.mk +include $(PROJECT_DIR)/config/engines/engines.mk +include $(PROJECT_DIR)/controllers/algo/algo.mk +include $(PROJECT_DIR)/controllers/core/core.mk +include $(PROJECT_DIR)/controllers/math/math.mk +include $(PROJECT_DIR)/controllers/sensors/sensors.mk +include $(PROJECT_DIR)/controllers/system/system.mk +include $(PROJECT_DIR)/controllers/trigger/trigger.mk +include $(PROJECT_DIR)/console/console.mk + + +# Define linker script file here +LDSCRIPT= config/stm32f4ems/STM32F407xG_CCM.ld + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(STARTUPSRC) \ + $(KERNSRC) \ + $(PORTSRC) \ + $(OSALSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/syscalls.c \ + $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ + $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ + $(CHIBIOS)/os/various/shell.c \ + ${HW_MASS_STORAGE_SRC_C} \ + $(UTILSRC) \ + $(ENGINES_SRC) \ + $(CONSOLESRC) \ + $(DEV_SRC) \ + $(HW_LAYER_EMS) \ + $(CONTROLLERSSRC) \ + $(CONTROLLERS_ALGO_SRC) \ + $(CONTROLLERS_CORE_SRC) \ + $(CONTROLLERS_SENSORS_SRC) \ + $(FATFSSRC) \ + $(SYSTEMSRC) + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = $(CHCPPSRC) \ + $(TRIGGER_SRC_CPP) \ + $(TRIGGER_DECODERS_SRC_CPP) \ + $(DEV_SRC_CPP) \ + $(CONTROLLERS_ALGO_SRC_CPP) \ + $(SYSTEMSRC_CPP) \ + $(ENGINES_SRC_CPP) \ + $(HW_LAYER_EMS_CPP) \ + $(HW_SENSORS_SRC) \ + $(TUNERSTUDIO_SRC_CPP) \ + $(CONSOLE_SRC_CPP) \ + $(CONTROLLERS_SENSORS_SRC_CPP) \ + $(CONTROLLERS_SRC_CPP) \ + $(UTILSRC_CPP) \ + $(CONTROLLERS_CORE_SRC_CPP) \ + $(CONTROLLERS_MATH_SRC_CPP) \ + rusefi.cpp \ + main.cpp + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) + +INCDIR = $(PORTINC) \ + $(OSALINC) \ + $(KERNINC) \ + $(TESTINC) \ + $(STARTUPINC) \ + $(HALINC) \ + $(PLATFORMINC) \ + $(BOARDINC) \ + $(CHCPPINC) \ + $(CHIBIOS)/os/hal/lib/streams \ + $(CHIBIOS)/os/various \ + $(CHIBIOS)/os/various/devices_lib/accel \ + config/stm32f4ems \ + config/engines \ + config \ + chibios/os/various \ + ext \ + ext_algo \ + util \ + console_util \ + console \ + $(PROJECT_DIR)/console/binary \ + $(PROJECT_DIR)/console/fl_binary \ + $(PROJECT_DIR)/hw_layer \ + $(PROJECT_DIR)/mass_storage \ + hw_layer/serial_over_usb \ + hw_layer/algo \ + hw_layer/lcd \ + hw_layer/sensors \ + hw_layer/mass_storage \ + hw_layer/stm32f4 \ + development \ + development/hw_layer \ + development/test \ + controllers \ + controllers/sensors \ + controllers/system \ + controllers/algo \ + controllers/core \ + controllers/math \ + controllers/trigger/decoders \ + controllers/trigger + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m4 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +OD = $(TRGT)objdump +SZ = $(TRGT)size +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +DDEFS = + +# List all default ASM defines here, like -D_DEBUG=1 +DADEFS = + +# List all default directories to look for include files here +DINCDIR = + +# List the default directory to look for the libraries here +DLIBDIR = + +# List all default libraries here +DLIBS = + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = -lm + +# +# End of user defines +############################################################################## + +RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC +include $(RULESPATH)/rules.mk From 210d25831d2fafb48ce0d8690b94ac005a7864f4 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 21:42:41 -0400 Subject: [PATCH 4/7] preparing for git on build server --- firmware/compile_and_program.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/compile_and_program.bat b/firmware/compile_and_program.bat index 475ffc3af0..1d954020f5 100644 --- a/firmware/compile_and_program.bat +++ b/firmware/compile_and_program.bat @@ -5,8 +5,7 @@ rm -rf build\rusefi.hex rm -rf build\rusefi.bin -rem todo add -rem git submodule update --init +git submodule update --init rem PS: rem git submodule update --recursive --remote rem magic once needed From 315fc4aff3f6aa8de4008dfd6047b2123e23d7bb Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 22:53:58 -0400 Subject: [PATCH 5/7] refactoring: tolower --- firmware/util/efilib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/util/efilib.h b/firmware/util/efilib.h index fc201d7456..32b9fa9de0 100644 --- a/firmware/util/efilib.h +++ b/firmware/util/efilib.h @@ -38,6 +38,7 @@ extern "C" #endif /* __cplusplus */ char * efiTrim(char *param); +int mytolower(const char c); uint32_t efiStrlen(const char *param); int efiPow10(int param); bool startsWith(const char *line, const char *prefix); From 6c7001ff085bdc1eee7b0d3f99e75321b14ae3e9 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 4 Apr 2017 23:00:21 -0400 Subject: [PATCH 6/7] refactoring: tolower --- firmware/hw_layer/mmc_card.cpp | 11 ----------- firmware/util/efilib.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 7618504f98..23d630a07c 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -207,17 +207,6 @@ static void removeFile(const char *pathx) { unlockSpi(); } -/* -** return lower-case of c if upper-case, else c -*/ -int mytolower(const char c) { - - if(c<='Z' && c>='A') return (c+32); - return (c); - -} - - int mystrncasecmp(const char *s1, const char *s2, size_t n) { diff --git a/firmware/util/efilib.cpp b/firmware/util/efilib.cpp index 9047e6bbaf..82ff775bc9 100644 --- a/firmware/util/efilib.cpp +++ b/firmware/util/efilib.cpp @@ -250,6 +250,13 @@ bool strEqualCaseInsensitive(const char *str1, const char *str2) { return true; } +/* +** return lower-case of c if upper-case, else c +*/ +int mytolower(const char c) { + return TO_LOWER(c); +} + bool strEqual(const char *str1, const char *str2) { // todo: there must be a standard function?! int len1 = strlen(str1); From 69296adee3dc078f69cac32cac0d3b9c1b3bffed Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 4 Apr 2017 23:17:56 -0400 Subject: [PATCH 7/7] minor bugfix: uPpEr cAsE not supported in command names --- firmware/hw_layer/adc_inputs.cpp | 2 +- firmware/hw_layer/mmc_card.cpp | 2 +- firmware/rusefi.cpp | 2 +- firmware/util/cli_registry.cpp | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index a05d626bec..b40f997514 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -554,7 +554,7 @@ void initAdcInputs(bool boardTestMode) { configureInputs(); // migrate to 'enable adcdebug' - addConsoleActionI("adcDebug", &setAdcDebugReporting); + addConsoleActionI("adcdebug", &setAdcDebugReporting); #if EFI_INTERNAL_ADC /* diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 23d630a07c..d9e90475d6 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -433,7 +433,7 @@ void initMmcCard(void) { chThdCreateStatic(mmcThreadStack, sizeof(mmcThreadStack), LOWPRIO, (tfunc_t) MMCmonThread, NULL); addConsoleAction("mountsd", MMCmount); - addConsoleActionS("appendToLog", appendToLog); + addConsoleActionS("appendtolog", appendToLog); addConsoleAction("umountsd", MMCumount); addConsoleActionS("ls", listDirectory); addConsoleActionS("del", removeFile); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 6fbeb7d92d..ec35f39b9a 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -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 20170402; + return 20170404; } diff --git a/firmware/util/cli_registry.cpp b/firmware/util/cli_registry.cpp index 5df8a8c0f1..afd6ea8c2f 100644 --- a/firmware/util/cli_registry.cpp +++ b/firmware/util/cli_registry.cpp @@ -47,6 +47,12 @@ void resetConsoleActions(void) { static void doAddAction(const char *token, action_type_e type, Void callback, void *param) { efiAssertVoid(consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions"); TokenCallback *current = &consoleActions[consoleActionCount++]; + for (int i = 0; i< efiStrlen(token);i++) { + char ch = token[i]; + if (ch != mytolower(ch)) { + firmwareError(CUSTOM_ERR_6140, "lowerCase expected [%s]", token); + } + } current->token = token; current->parameterType = type; current->callback = callback;