This commit is contained in:
rusefillc 2022-06-02 15:23:40 -04:00
commit 68801865f3
32 changed files with 79 additions and 65 deletions

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/48way/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/48way/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -69,7 +69,7 @@ pins:
class: outputs class: outputs
ts_name: Injector 1 Output (E15) ts_name: Injector 1 Output (E15)
- id: E1 - id: E1
class: analog_inputs class: switch_inputs
ts_name: Clutch Input (E1) ts_name: Clutch Input (E1)
- id: C7 - id: C7
class: outputs class: outputs

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/core8/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/core8/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,7 +1,7 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/frankenso/connectors/internal.yaml // auto-generated by PinoutLogic.java based on config/boards/frankenso/connectors/internal.yaml
// auto-generated by PinoutLogic.java based on config/boards/frankenso/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/frankenso/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/alphax-2chan/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/alphax-2chan/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/alphax-4chan/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/alphax-4chan/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/harley81/connectors/harley81.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/harley81/connectors/harley81.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,8 +1,8 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-grey.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-grey.yaml
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-blue.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-blue.yaml
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-black.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-gm-e67/connectors/gm-e67-black.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -126,7 +126,7 @@ pins:
- pin: 64 - pin: 64
# H144_IN_TPS # H144_IN_TPS
id: EFI_ADC_4 id: EFI_ADC_4
class: outputs class: analog_inputs
ts_name: C2-64 - TPS1 ts_name: C2-64 - TPS1
function: TPS1 function: TPS1
type: av type: av
@ -135,7 +135,7 @@ pins:
- pin: 66 - pin: 66
# H144_IN_AUX1 # H144_IN_AUX1
id: EFI_ADC_8 id: EFI_ADC_8
class: outputs class: analog_inputs
ts_name: C2-66 - TPS2 ts_name: C2-66 - TPS2
function: TPS2 function: TPS2
type: av type: av

View File

@ -11,6 +11,7 @@ pins:
# H144_IN_CLT # H144_IN_CLT
id: EFI_ADC_12 id: EFI_ADC_12
type: av type: av
class: analog_inputs
ts_name: C3-55 - CLT ts_name: C3-55 - CLT
function: CLT function: CLT
color: purple color: purple
@ -19,6 +20,7 @@ pins:
# H144_IN_IAT # H144_IN_IAT
id: EFI_ADC_13 id: EFI_ADC_13
type: av type: av
class: analog_inputs
ts_name: C3-56 - IAT ts_name: C3-56 - IAT
function: CLT function: CLT
color: purple color: purple

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-nb1/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen-nb1/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -20,8 +20,8 @@ pins:
type: can type: can
- pin: 1F - pin: 1F
id: [F9, ADC3_CHANNEL_7] id: [F9]
class: [switch_inputs, analog_inputs] class: [switch_inputs]
ts_name: 1F - Brake/RES1 ts_name: 1F - Brake/RES1
function: Brake Switch function: Brake Switch
@ -127,9 +127,9 @@ pins:
function: CLT sensor function: CLT sensor
- pin: 2F - pin: 2F
id: F7 # id: F7
class: analog_inputs # class: analog_inputs
ts_name: 2M - KNOCK # ts_name: 2M - KNOCK
function: Knock sens. in function: Knock sens. in
- pin: 2H - pin: 2H

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen121nissan/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen121nissan/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen121vag/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen121vag/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -116,8 +116,8 @@ pins:
type: ls type: ls
- pin: 38 - pin: 38
id: [F9, ADC3_CHANNEL_7] id: [F9]
class: [switch_inputs, analog_inputs] class: [switch_inputs]
ts_name: 48 - IN RES1 ts_name: 48 - IN RES1
function: IN_RES1 function: IN_RES1

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen128/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen128/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen154hyundai/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen154hyundai/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen64_miataNA6_94/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen64_miataNA6_94/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen72/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen72/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -284,8 +284,8 @@ pins:
color: black W4 color: black W4
- pin: 4B - pin: 4B
id: [F9, ADC3_CHANNEL_7] id: [F9]
class: [switch_inputs, analog_inputs] class: [switch_inputs]
ts_name: 4B - Brake/RES1 (A7) ts_name: 4B - Brake/RES1 (A7)
function: Brake Switch function: Brake Switch

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen81/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen81/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -64,9 +64,9 @@ pins:
- pin: 9 - pin: 9
function: Fuel Level / CLT Analog Input function: Fuel Level / CLT Analog Input
id: F5 # id: F5
class: analog_inputs # class: analog_inputs
ts_name: 9 - IN_SENS3 # ts_name: 9 - IN_SENS3
color: white color: white
- pin: 10 - pin: 10

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellen88bmw/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellen88bmw/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/hellen/hellenNA8_96/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/hellen/hellenNA8_96/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -62,15 +62,15 @@ pins:
function: GND function: GND
- pin: 1Q - pin: 1Q
id: [F9, ADC3_CHANNEL_7] id: [F9]
class: [switch_inputs, analog_inputs] class: [switch_inputs]
ts_name: 1Q - Brake/RES1 ts_name: 1Q - Brake/RES1
function: Brake Switch function: Brake Switch
- pin: 1S - pin: 1S
id: F7 # id: F7
class: analog_inputs # class: analog_inputs
ts_name: 2M - KNOCK # ts_name: 2M - KNOCK
function: Knock sens. in function: Knock sens. in
- pin: 1U - pin: 1U

View File

@ -1,8 +1,8 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/J4.yaml // auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/J4.yaml
// auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/pads.yaml // auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/pads.yaml
// auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/microrusefi/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,8 +1,8 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/black35.yaml // auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/black35.yaml
// auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/white35.yaml // auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/white35.yaml
// auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/black23.yaml // auto-generated by PinoutLogic.java based on config/boards/proteus/connectors/black23.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -89,10 +89,10 @@ pins:
type: 12V type: 12V
- pin: 16 - pin: 16
id: EFI_ADC3_10 # id: EFI_ADC3_10
class: analog_inputs # class: analog_inputs
function: Atm Pressure Sensor output to TCU function: Atm Pressure Sensor output to TCU
ts_name: (BUG!) A16 - Atm Pressure Sensor Ain # ts_name: (BUG!) A16 - Atm Pressure Sensor Ain
type: av type: av
- pin: 17 - pin: 17

View File

@ -1,10 +1,10 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/C-B61.yaml // auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/C-B61.yaml
// auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/XP2-AUX0.yaml // auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/XP2-AUX0.yaml
// auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/A-B59.yaml // auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/A-B59.yaml
// auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/B-B60.yaml // auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/B-B60.yaml
// auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/D-B62.yaml // auto-generated by PinoutLogic.java based on config/boards/subaru_eg33/connectors/D-B62.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

View File

@ -1,6 +1,6 @@
//DO NOT EDIT MANUALLY, let automation work hard. //DO NOT EDIT MANUALLY, let automation work hard.
// auto-generated by PinoutLogic.java based on config/boards/tdg-pdm8/connectors/main.yaml // auto-generated by PinoutLogic.java based on config/boards/tdg-pdm8/connectors/main.yaml
#include "pch.h" #include "pch.h"
// see comments at declaration in pin_repository.h // see comments at declaration in pin_repository.h

Binary file not shown.

View File

@ -34,7 +34,16 @@ public class PinoutLogic {
this.boardYamlFiles = boardYamlFiles; this.boardYamlFiles = boardYamlFiles;
} }
private static void registerPins(ArrayList<PinState> listPins, VariableRegistry registry, ReaderState state) { private static Map.Entry<String, Value> find(EnumsReader.EnumState enumList, String id) {
for (Map.Entry<String, Value> kv : enumList.entrySet()) {
if (kv.getKey().equals(id)) {
return kv;
}
}
return null;
}
private static void registerPins(String boardName, ArrayList<PinState> listPins, VariableRegistry registry, ReaderState state) {
if (listPins == null || listPins.isEmpty()) { if (listPins == null || listPins.isEmpty()) {
return; return;
} }
@ -54,17 +63,17 @@ public class PinoutLogic {
String pinType = listPinType.getPinType(); String pinType = listPinType.getPinType();
EnumsReader.EnumState enumList = state.enumsReader.getEnums().get(pinType); EnumsReader.EnumState enumList = state.enumsReader.getEnums().get(pinType);
Objects.requireNonNull(enumList, "Enum for " + pinType); Objects.requireNonNull(enumList, "Enum for " + pinType);
for (Map.Entry<String, Value> kv : enumList.entrySet()) { Map.Entry<String, Value> kv = find(enumList, id);
if (kv.getKey().equals(id)) { if (kv == null) {
throw new IllegalStateException(boardName + ": Not found " + id + " in " + className);
}
int index = kv.getValue().getIntValue(); int index = kv.getValue().getIntValue();
classList.ensureCapacity(index + 1); classList.ensureCapacity(index + 1);
for (int ii = classList.size(); ii <= index; ii++) { for (int ii = classList.size(); ii <= index; ii++) {
classList.add(null); classList.add(null);
} }
classList.set(index, listPin.getPinTsName()); classList.set(index, listPin.getPinTsName());
break;
}
}
} }
for (Map.Entry<String, ArrayList<String>> kv : names.entrySet()) { for (Map.Entry<String, ArrayList<String>> kv : names.entrySet()) {
PinType namePinType = PinType.find(kv.getKey()); PinType namePinType = PinType.find(kv.getKey());
@ -176,20 +185,23 @@ public class PinoutLogic {
PinState thisPin = new PinState(id, pinTsName, pinClass); PinState thisPin = new PinState(id, pinTsName, pinClass);
globalList.add(thisPin); globalList.add(thisPin);
} }
/*
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
PinoutLogic logic = create("hellen-gm-e67","../../firmware/config/boards/hellen/"); String boardName = "hellen-gm-e67";
PinoutLogic logic = create(boardName,"../../firmware/config/boards/hellen/");
logic.readFiles(); logic.readFiles();
log.info(logic.toString()); log.info(logic.toString());
registerPins(logic.globalList, new VariableRegistry(), new ReaderState()); registerPins(boardName, logic.globalList, new VariableRegistry(), new ReaderState());
} }
*/
public static PinoutLogic create(String boardName, String rootFolder) { public static PinoutLogic create(String boardName, String rootFolder) {
String dirPath = rootFolder + boardName + PinoutLogic.CONNECTORS; String dirPath = rootFolder + boardName + PinoutLogic.CONNECTORS;
File dirName = new File(dirPath); File dirName = new File(dirPath);
FilenameFilter filter = (f, name) -> name.endsWith(".yaml"); FilenameFilter filter = (f, name) -> name.endsWith(".yaml");
File[] boardYamlFiles = dirName.listFiles(filter); File[] boardYamlFiles = dirName.listFiles(filter);
Arrays.sort(boardYamlFiles);
if (boardYamlFiles == null) { if (boardYamlFiles == null) {
log.info("No yaml files in " + dirPath); log.info("No yaml files in " + dirPath);
return null; return null;
@ -199,7 +211,7 @@ public class PinoutLogic {
public void registerBoardSpecificPinNames(VariableRegistry registry, ReaderState state) throws IOException { public void registerBoardSpecificPinNames(VariableRegistry registry, ReaderState state) throws IOException {
readFiles(); readFiles();
registerPins(globalList, registry, state); registerPins(boardName, globalList, registry, state);
try (FileWriter getTsNameByIdFile = new FileWriter(PinoutLogic.CONFIG_BOARDS + boardName + PinoutLogic.CONNECTORS + File.separator + "generated_ts_name_by_pin.cpp")) { try (FileWriter getTsNameByIdFile = new FileWriter(PinoutLogic.CONFIG_BOARDS + boardName + PinoutLogic.CONNECTORS + File.separator + "generated_ts_name_by_pin.cpp")) {
getTsNameByIdFile.append(header); getTsNameByIdFile.append(header);