From f0bd4f033d96c666e29f855448f95a4e2e45acb3 Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 20 May 2020 09:16:26 -0400 Subject: [PATCH] progress --- firmware/controllers/algo/auto_generated_enums.h | 9 ++------- firmware/gen_enum_to_string.bat | 3 +++ .../enum_to_string/src/com/rusefi/EnumToString.java | 11 ++++------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/firmware/controllers/algo/auto_generated_enums.h b/firmware/controllers/algo/auto_generated_enums.h index dc69bfb8ed..093b8ecfae 100644 --- a/firmware/controllers/algo/auto_generated_enums.h +++ b/firmware/controllers/algo/auto_generated_enums.h @@ -1,15 +1,11 @@ -// was generated automatically by rusEfi tool from rusefi_hw_enums.h -// was generated automatically by rusEfi tool from rusefi_enums.h -// by enum2string.jar tool -// on Wed May 20 00:37:41 EDT 2020 +// was generated automatically by rusEfi tool from rusefi_hw_enums.h // was generated automatically by rusEfi tool from rusefi_enums.h // by enum2string.jar tool on Wed May 20 09:04:42 EDT 2020 // see also gen_config_and_enums.bat #include "rusefi_enums.h" #include "rusefi_hw_enums.h" -#ifndef _A_H_HEADER_ -#define _A_H_HEADER_ +#pragma once const char *getPidAutoTune_AutoTunerState(PidAutoTune_AutoTunerState value); const char *getPidAutoTune_Peak(PidAutoTune_Peak value); const char *getAdc_channel_e(adc_channel_e value); @@ -56,4 +52,3 @@ const char *getTrigger_value_e(trigger_value_e value); const char *getTrigger_wheel_e(trigger_wheel_e value); const char *getUart_device_e(uart_device_e value); const char *getVvt_mode_e(vvt_mode_e value); -#endif /*_A_H_HEADER_ */ diff --git a/firmware/gen_enum_to_string.bat b/firmware/gen_enum_to_string.bat index f01ba2c86a..0d14ffbd6d 100644 --- a/firmware/gen_enum_to_string.bat +++ b/firmware/gen_enum_to_string.bat @@ -9,3 +9,6 @@ java -DSystemOut.name=gen_enum_to_string ^ -enumInputFile controllers/algo/rusefi_enums.h ^ -enumInputFile controllers/algo/rusefi_hw_enums.h ^ +pwd +cd config/boards/kinetis/config +call "!gen_enum_to_string.bat" \ No newline at end of file diff --git a/java_tools/enum_to_string/src/com/rusefi/EnumToString.java b/java_tools/enum_to_string/src/com/rusefi/EnumToString.java index ed2353d0d8..078fe8ea53 100644 --- a/java_tools/enum_to_string/src/com/rusefi/EnumToString.java +++ b/java_tools/enum_to_string/src/com/rusefi/EnumToString.java @@ -17,8 +17,8 @@ public class EnumToString { private final static StringBuilder cppFileContent = new StringBuilder(); private final static StringBuilder includesSection = new StringBuilder(); - private final static StringBuilder bothFilesHeader = new StringBuilder("// by enum2string.jar tool\n" + - "// on " + new Date() + "\n" + + private final static StringBuilder bothFilesHeader = new StringBuilder("// by enum2string.jar tool " + + "on " + new Date() + "\n" + "// see also gen_config_and_enums.bat\n" + "\n" + "\n" + @@ -55,8 +55,7 @@ public class EnumToString { } - headerFileContent.append("#ifndef _A_H_HEADER_\n"); - headerFileContent.append("#define _A_H_HEADER_\n"); + headerFileContent.append("#pragma once\n"); outputData(); @@ -70,8 +69,6 @@ public class EnumToString { cppFileContent.insert(0, "#include \"global.h\"\n"); headerFileContent.insert(0, bothFilesHeader.toString()); - headerFileContent.append("#endif /*_A_H_HEADER_ */\n"); - new File(outputPath).mkdirs(); writeCppAndHeaderFiles(outputPath + File.separator + "auto_generated_enums"); SystemOut.close(); @@ -93,7 +90,7 @@ public class EnumToString { String simpleFileName = f.getName(); bothFilesHeader.insert(0, "// " + - LazyFile.LAZY_FILE_TAG + " from " + simpleFileName + "\n"); + LazyFile.LAZY_FILE_TAG + " from " + simpleFileName + " "); includesSection.append("#include \"" + simpleFileName + "\"\n"); EnumsReader.process(new FileReader(inFileName));