Merge branch 'master' of https://github.com/rusefi/rusefi
This commit is contained in:
commit
68801865f3
|
@ -69,7 +69,7 @@ pins:
|
|||
class: outputs
|
||||
ts_name: Injector 1 Output (E15)
|
||||
- id: E1
|
||||
class: analog_inputs
|
||||
class: switch_inputs
|
||||
ts_name: Clutch Input (E1)
|
||||
- id: C7
|
||||
class: outputs
|
||||
|
|
|
@ -126,7 +126,7 @@ pins:
|
|||
- pin: 64
|
||||
# H144_IN_TPS
|
||||
id: EFI_ADC_4
|
||||
class: outputs
|
||||
class: analog_inputs
|
||||
ts_name: C2-64 - TPS1
|
||||
function: TPS1
|
||||
type: av
|
||||
|
@ -135,7 +135,7 @@ pins:
|
|||
- pin: 66
|
||||
# H144_IN_AUX1
|
||||
id: EFI_ADC_8
|
||||
class: outputs
|
||||
class: analog_inputs
|
||||
ts_name: C2-66 - TPS2
|
||||
function: TPS2
|
||||
type: av
|
||||
|
|
|
@ -11,6 +11,7 @@ pins:
|
|||
# H144_IN_CLT
|
||||
id: EFI_ADC_12
|
||||
type: av
|
||||
class: analog_inputs
|
||||
ts_name: C3-55 - CLT
|
||||
function: CLT
|
||||
color: purple
|
||||
|
@ -19,6 +20,7 @@ pins:
|
|||
# H144_IN_IAT
|
||||
id: EFI_ADC_13
|
||||
type: av
|
||||
class: analog_inputs
|
||||
ts_name: C3-56 - IAT
|
||||
function: CLT
|
||||
color: purple
|
||||
|
|
|
@ -20,8 +20,8 @@ pins:
|
|||
type: can
|
||||
|
||||
- pin: 1F
|
||||
id: [F9, ADC3_CHANNEL_7]
|
||||
class: [switch_inputs, analog_inputs]
|
||||
id: [F9]
|
||||
class: [switch_inputs]
|
||||
ts_name: 1F - Brake/RES1
|
||||
function: Brake Switch
|
||||
|
||||
|
@ -127,9 +127,9 @@ pins:
|
|||
function: CLT sensor
|
||||
|
||||
- pin: 2F
|
||||
id: F7
|
||||
class: analog_inputs
|
||||
ts_name: 2M - KNOCK
|
||||
# id: F7
|
||||
# class: analog_inputs
|
||||
# ts_name: 2M - KNOCK
|
||||
function: Knock sens. in
|
||||
|
||||
- pin: 2H
|
||||
|
|
|
@ -116,8 +116,8 @@ pins:
|
|||
type: ls
|
||||
|
||||
- pin: 38
|
||||
id: [F9, ADC3_CHANNEL_7]
|
||||
class: [switch_inputs, analog_inputs]
|
||||
id: [F9]
|
||||
class: [switch_inputs]
|
||||
ts_name: 48 - IN RES1
|
||||
function: IN_RES1
|
||||
|
||||
|
|
|
@ -284,8 +284,8 @@ pins:
|
|||
color: black W4
|
||||
|
||||
- pin: 4B
|
||||
id: [F9, ADC3_CHANNEL_7]
|
||||
class: [switch_inputs, analog_inputs]
|
||||
id: [F9]
|
||||
class: [switch_inputs]
|
||||
ts_name: 4B - Brake/RES1 (A7)
|
||||
function: Brake Switch
|
||||
|
||||
|
|
|
@ -64,9 +64,9 @@ pins:
|
|||
|
||||
- pin: 9
|
||||
function: Fuel Level / CLT Analog Input
|
||||
id: F5
|
||||
class: analog_inputs
|
||||
ts_name: 9 - IN_SENS3
|
||||
# id: F5
|
||||
# class: analog_inputs
|
||||
# ts_name: 9 - IN_SENS3
|
||||
color: white
|
||||
|
||||
- pin: 10
|
||||
|
|
|
@ -62,15 +62,15 @@ pins:
|
|||
function: GND
|
||||
|
||||
- pin: 1Q
|
||||
id: [F9, ADC3_CHANNEL_7]
|
||||
class: [switch_inputs, analog_inputs]
|
||||
id: [F9]
|
||||
class: [switch_inputs]
|
||||
ts_name: 1Q - Brake/RES1
|
||||
function: Brake Switch
|
||||
|
||||
- pin: 1S
|
||||
id: F7
|
||||
class: analog_inputs
|
||||
ts_name: 2M - KNOCK
|
||||
# id: F7
|
||||
# class: analog_inputs
|
||||
# ts_name: 2M - KNOCK
|
||||
function: Knock sens. in
|
||||
|
||||
- pin: 1U
|
||||
|
|
|
@ -89,10 +89,10 @@ pins:
|
|||
type: 12V
|
||||
|
||||
- pin: 16
|
||||
id: EFI_ADC3_10
|
||||
class: analog_inputs
|
||||
# id: EFI_ADC3_10
|
||||
# class: analog_inputs
|
||||
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
|
||||
|
||||
- pin: 17
|
||||
|
|
Binary file not shown.
|
@ -34,7 +34,16 @@ public class PinoutLogic {
|
|||
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()) {
|
||||
return;
|
||||
}
|
||||
|
@ -54,17 +63,17 @@ public class PinoutLogic {
|
|||
String pinType = listPinType.getPinType();
|
||||
EnumsReader.EnumState enumList = state.enumsReader.getEnums().get(pinType);
|
||||
Objects.requireNonNull(enumList, "Enum for " + pinType);
|
||||
for (Map.Entry<String, Value> kv : enumList.entrySet()) {
|
||||
if (kv.getKey().equals(id)) {
|
||||
Map.Entry<String, Value> kv = find(enumList, id);
|
||||
if (kv == null) {
|
||||
throw new IllegalStateException(boardName + ": Not found " + id + " in " + className);
|
||||
}
|
||||
|
||||
int index = kv.getValue().getIntValue();
|
||||
classList.ensureCapacity(index + 1);
|
||||
for (int ii = classList.size(); ii <= index; ii++) {
|
||||
classList.add(null);
|
||||
}
|
||||
classList.set(index, listPin.getPinTsName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, ArrayList<String>> kv : names.entrySet()) {
|
||||
PinType namePinType = PinType.find(kv.getKey());
|
||||
|
@ -176,20 +185,23 @@ public class PinoutLogic {
|
|||
PinState thisPin = new PinState(id, pinTsName, pinClass);
|
||||
globalList.add(thisPin);
|
||||
}
|
||||
|
||||
/*
|
||||
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();
|
||||
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) {
|
||||
String dirPath = rootFolder + boardName + PinoutLogic.CONNECTORS;
|
||||
File dirName = new File(dirPath);
|
||||
FilenameFilter filter = (f, name) -> name.endsWith(".yaml");
|
||||
File[] boardYamlFiles = dirName.listFiles(filter);
|
||||
Arrays.sort(boardYamlFiles);
|
||||
if (boardYamlFiles == null) {
|
||||
log.info("No yaml files in " + dirPath);
|
||||
return null;
|
||||
|
@ -199,7 +211,7 @@ public class PinoutLogic {
|
|||
|
||||
public void registerBoardSpecificPinNames(VariableRegistry registry, ReaderState state) throws IOException {
|
||||
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")) {
|
||||
getTsNameByIdFile.append(header);
|
||||
|
|
Loading…
Reference in New Issue