board-specific usability #808

This commit is contained in:
rusefi 2019-05-30 20:41:54 -04:00
parent 67892959a3
commit 0334f20fd1
9 changed files with 6952 additions and 12 deletions

View File

@ -0,0 +1,43 @@
outputs:
GPIOB_7: "Injector 3Z"
GPIOB_8: "Injector 3Y"
GPIOB_9: "Injector 3W"
GPIOC_13: "Injector 2M"
GPIOD_3: "Injector 3U"
GPIOD_5: "Injector 3X"
GPIOD_7: "Injector 2N"
GPIOE_2: "Injector 3V"
GPIOE_3: "Injector 3S"
GPIOE_4: "Injector 3T"
GPIOE_5: "Injector 2O"
GPIOE_6: "Injector 2P"
GPIOC_7: "Coil 1H"
GPIOC_9: "Coil 1F"
GPIOD_8: "Coil 1O"
GPIOD_9: "Coil 1P"
GPIOE_8: "Coil 1L"
GPIOE_10: "Coil 1I"
GPIOE_12: "Coil 1M"
GPIOE_14: "Coil 1G"
analog_inputs:
EFI_ADC_0: "Analog 3O"
EFI_ADC_1: "Analog 3L"
EFI_ADC_2: "Analog 3M"
EFI_ADC_3: "Analog 3J"
EFI_ADC_4: "Analog 3I"
EFI_ADC_6: "Analog 3H"
EFI_ADC_7: "Analog 3G"
EFI_ADC_11: "Analog 3P"
EFI_ADC_12: "Analog 3Q"
EFI_ADC_13: "Analog 3N"
EFI_ADC_14: "Analog VBatt"
EFI_ADC_15: "Analog 3E"

View File

@ -0,0 +1,7 @@
# TODO if anyone would be interested
outputs:
GPIOB_7: "Injector 3Z"
analog_inputs:
EFI_ADC_0: "Analog 3O"

View File

@ -11,4 +11,8 @@ java -jar ../java_tools/ConfigDefinition.jar -definition integration\rusefi_conf
rem This would automatically copy latest file to 'dev' TS project
set ts_path="%HOMEDRIVE%%HOMEPATH%\Documents\TunerStudioProjects\dev\projectCfg"
echo %ts_path%
cp tunerstudio/rusefi.ini %ts_path%\mainController.ini
cp tunerstudio/rusefi.ini %ts_path%\mainController.ini
call gen_config_board microrusefi
call gen_config_board frankenso
call gen_config_board prometheus

View File

@ -1,15 +1,25 @@
@echo off
rem This batch files reads rusefi_config.txt and produses firmware persistent configuration headers
rem the storage section of rusefi.ini is updated as well
set BOARDNAME=%1
if %BOARDNAME%.==. (
echo Board name parameter expected
exit -1
)
echo BOARDNAME=%BOARDNAME%
rem lazy is broken - TS input is not considered a change
rm build/config.gen
java -cp ../java_tools/ConfigDefinition.jar;../java_tools/configuration_definition/lib/snakeyaml.jar com.rusefi.board_generator.BoardReader -board microrusefi -firmware_path .
java -jar ../java_tools/ConfigDefinition.jar -definition integration\rusefi_config.txt -ts_destination tunerstudio -ts_output_name rusefi_microrusefi.ini -prepend microrusefi_prefix.txt -skip build/config.gen
java -cp ../java_tools/ConfigDefinition.jar;../java_tools/configuration_definition/lib/snakeyaml.jar com.rusefi.board_generator.BoardReader -board %BOARDNAME% -firmware_path . -out tunerstudio
java -jar ../java_tools/ConfigDefinition.jar -definition integration\rusefi_config.txt -ts_destination tunerstudio -ts_output_name rusefi_%BOARDNAME%.ini -prepend tunerstudio/%BOARDNAME%_prefix.txt -skip build/config.gen
rem This would automatically copy latest file to 'dev' TS project
set ts_path="%HOMEDRIVE%%HOMEPATH%\Documents\TunerStudioProjects\dev\projectCfg"
echo %ts_path%
cp tunerstudio/rusefi_microrusefi.ini %ts_path%\mainController.ini
rem cp tunerstudio/rusefi_microrusefi.ini %ts_path%\mainController.ini

1
firmware/tunerstudio/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*prefix.txt

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -5,17 +5,15 @@ import com.rusefi.EnumsReader;
import com.rusefi.enum_reader.Value;
import org.yaml.snakeyaml.Yaml;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
import java.util.Collection;
import java.util.Map;
public class BoardReader {
private static final String KEY_BOARD_NAME = "-board";
private static final String KEY_OUTFOLDER = "-out";
private static final String KEY_FIRMWARE_PATH = "-firmware_path";
public static final String INVALID = "INVALID";
private static final String INVALID = "INVALID";
public static void main(String[] args) throws IOException {
if (args.length < 2) {
@ -28,12 +26,15 @@ public class BoardReader {
String boardName = null;
String firmwarePath = "firmware";
String outputPath = ".";
for (int i = 0; i < args.length - 1; i += 2) {
String key = args[i];
if (key.equals(KEY_BOARD_NAME)) {
boardName = args[i + 1];
} else if (key.equals(KEY_FIRMWARE_PATH)) {
firmwarePath = args[i + 1];
} else if (key.equals(KEY_OUTFOLDER)) {
outputPath = args[i + 1];
}
}
@ -41,9 +42,9 @@ public class BoardReader {
Map<String, Object> data = yaml.load(new FileReader(firmwarePath + "/config/boards/" + boardName + "/mapping.yaml"));
System.out.println(data);
EnumsReader.process(new FileReader(firmwarePath + "/" + EnumToString.RELATIVE_PATH));
EnumsReader.process(new FileReader(firmwarePath + File.separator + EnumToString.RELATIVE_PATH));
BufferedWriter bw = new BufferedWriter(new FileWriter(boardName + "_prefix.txt"));
BufferedWriter bw = new BufferedWriter(new FileWriter(outputPath + File.separator + boardName + "_prefix.txt"));
bw.write(processSection(data, "brain_pin_e", "outputs", "GPIO_UNASSIGNED"));
bw.write(processSection(data, "adc_channel_e", "analog_inputs", "EFI_ADC_NONE"));