This commit is contained in:
rusefillc 2023-07-09 21:54:54 -04:00
parent b8b9a3da07
commit 8edfaffa13
4 changed files with 27 additions and 10 deletions

View File

@ -29,6 +29,15 @@ void setHyundaiPb() {
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_60_2;
engineConfiguration->globalTriggerAngleOffset = 90;
engineConfiguration->etbIdleThrottleRange = 6.0;
engineConfiguration->totalGearsCount = 5;
engineConfiguration->gearRatio[0] = 12;
engineConfiguration->gearRatio[1] = 6;
engineConfiguration->gearRatio[2] = 4.4;
engineConfiguration->gearRatio[3] = 2.4;
engineConfiguration->gearRatio[4] = 1;
// ETB buzzing is annoying :(
engineConfiguration->disableEtbWhenEngineStopped = true;
@ -48,7 +57,7 @@ void setHyundaiPb() {
engineConfiguration->map.sensor.highValue = 101.3;
engineConfiguration->mapHighValueVoltage = 4;
engineConfiguration->mc33_hpfp_i_peak = 8;
engineConfiguration->mc33_hpfp_i_peak = 10;
engineConfiguration->mc33_hpfp_i_hold = 4;
engineConfiguration->vvtMode[0] = VVT_SECOND_HALF;

View File

@ -150,6 +150,14 @@ public interface ConfigField {
}
};
default String getOriginalArrayName() {
if (isFromIterate()) {
return getIterateOriginalName() + "[" + (getIterateIndex() - 1) + "]";
} else {
return getName();
}
}
ConfigStructure getStructureType();
boolean isArray();

View File

@ -32,12 +32,8 @@ public class SdCardFieldsContent {
if (configField.isBit())
return "";
if (configField.isFromIterate()) {
String name = configField.getIterateOriginalName() + "[" + (configField.getIterateIndex() - 1) + "]";
return getLine(configField, prefix, prefix + name);
} else {
return getLine(configField, prefix, prefix + configField.getName());
}
String name = configField.getOriginalArrayName();
return getLine(configField, prefix, prefix + name);
}
private String getLine(ConfigField configField, String prefix, String name) {

View File

@ -43,6 +43,7 @@ public class TuneCanTool {
RootHolder.ROOT = "../firmware/";
handle("PB", 1502);
handle("Mitsubicha", 1258);
handle("Scion-1NZ-FE", 1448);
handle("4g93", 1425);
@ -132,6 +133,7 @@ public class TuneCanTool {
System.out.println("Not found " + name);
continue;
}
String cName = cf.getOriginalArrayName();
if (cf.getType().equals("boolean")) {
sb.append(TuneTools.getAssignmentCode(defaultValue, customValue.getName(), unquote(customValue.getValue())));
@ -168,11 +170,13 @@ public class TuneCanTool {
continue;
}
boolean isInteger = !customValue.getValue().contains(".");
double doubleValue = Double.valueOf(customValue.getValue());
int intValue = (int) doubleValue;
boolean isInteger = intValue == doubleValue;
if (isInteger) {
sb.append(TuneTools.getAssignmentCode(defaultValue, customValue.getName(), customValue.getValue()));
sb.append(TuneTools.getAssignmentCode(defaultValue, cName, Integer.toString(intValue)));
} else {
sb.append(TuneTools.getAssignmentCode(defaultValue, customValue.getName(), niceToString(Double.valueOf(customValue.getValue()))));
sb.append(TuneTools.getAssignmentCode(defaultValue, cName, niceToString(doubleValue)));
}
}
}