User board-specific terms in error messages #3886

This commit is contained in:
rusefillc 2022-02-03 14:27:47 -05:00
parent c17ccff922
commit 1b73e96152
3 changed files with 27 additions and 4 deletions

View File

@ -26,6 +26,13 @@ endif
-include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/config.mk
PIN_NAMES_FILE=$(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/connectors/generated_ts_name_by_pin.cpp
ifneq ("$(wildcard $(PIN_NAMES_FILE))","")
$(info found $(PIN_NAMES_FILE) )
ALLCPPSRC += $(PIN_NAMES_FILE)
endif
# CPU-dependent defs
ifeq ($(PROJECT_CPU),ARCH_STM32F7)
CPU_STARTUP = startup_stm32f7xx.mk

Binary file not shown.

View File

@ -4,10 +4,7 @@ import com.rusefi.enum_reader.Value;
import com.rusefi.util.SystemOut;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.*;
import java.util.*;
public class PinoutLogic {
@ -153,6 +150,25 @@ public class PinoutLogic {
processYamlFile(yamlFile);
}
registerPins(globalList, registry, state);
try (FileWriter getTsNameByIdFile = new FileWriter(PinoutLogic.CONFIG_BOARDS + boardName + PinoutLogic.CONNECTORS + File.separator + "generated_ts_name_by_pin.cpp")) {
getTsNameByIdFile.append("// auto-generated by PinoutLogic.java\n\n");
getTsNameByIdFile.append("#include \"pch.h\"\n\n");
getTsNameByIdFile.append("const char * getBoardSpecificPinName(brain_pin_e brainPin) {\n");
getTsNameByIdFile.append("\tswitch(brainPin) {\n");
for (Map.Entry</*id*/String, /*tsName*/String> e : tsNameById.entrySet()) {
getTsNameByIdFile.append("\t\tcase " + e.getKey() + ": return " + quote(e.getValue()) + ";\n");
}
getTsNameByIdFile.append("\t}\n");
getTsNameByIdFile.append("\treturn nullptr;\n}\n");
}
}
private String quote(String value) {
return "\"" + value + "\"";
}
public List<String> getInputFiles() {