clutch input via CAN #3605
This commit is contained in:
parent
86506a15a9
commit
df354a338e
|
@ -9,6 +9,7 @@ java -DSystemOut.name=logs/gen_output_channels \
|
|||
-cache_zip_file tunerstudio/generated/cache.zip \
|
||||
-prepend integration/rusefi_config.txt \
|
||||
-definition console/binary/output_channels.txt \
|
||||
-output_lookup_file controllers/lua/generated/output_lookup_generated.cpp \
|
||||
-ts_outputs_section console/binary/ \
|
||||
-cache . \
|
||||
-with_c_defines false \
|
||||
|
|
Binary file not shown.
|
@ -15,6 +15,7 @@ public class TypesHelper {
|
|||
private static final String FLOAT_T = "float";
|
||||
private static final String INT_32_T = "int";
|
||||
private static final String UINT_32_T = "uint32_t";
|
||||
private static final String BOOLEAN_T = "boolean";
|
||||
|
||||
public static int getElementSize(ReaderState state, String type) {
|
||||
Objects.requireNonNull(state);
|
||||
|
@ -81,6 +82,10 @@ public class TypesHelper {
|
|||
return type;
|
||||
}
|
||||
|
||||
public static boolean isBoolean(String type) {
|
||||
return BOOLEAN_T.equals(type);
|
||||
}
|
||||
|
||||
public static boolean isFloat(String type) {
|
||||
return FLOAT_T.equals(type) ||
|
||||
// todo: something smarter with dynamic type definition?
|
||||
|
|
|
@ -62,7 +62,7 @@ public class GetConfigValueConsumer extends AbstractConfigurationConsumer {
|
|||
|
||||
if (cf.isArray() || cf.isFromIterate() || cf.isDirective())
|
||||
return "";
|
||||
if (!TypesHelper.isPrimitive(cf.getType())) {
|
||||
if (!TypesHelper.isPrimitive(cf.getType()) && !TypesHelper.isBoolean(cf.getType())) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class GetOutputValueConsumer extends AbstractConfigurationConsumer {
|
|||
|
||||
if (cf.isArray() || cf.isFromIterate() || cf.isDirective())
|
||||
return "";
|
||||
if (!TypesHelper.isPrimitive(cf.getType())) {
|
||||
if (!TypesHelper.isPrimitive(cf.getType()) && !TypesHelper.isBoolean(cf.getType())) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,10 @@ public class OutputsTest {
|
|||
assertEquals(
|
||||
"#include \"pch.h\"\n" +
|
||||
"float getOutputValueByName(const char *name) {\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"issue_294_31\"))\n" +
|
||||
"\t\treturn engine->outputChannels.issue_294_31;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"enableFan1WithAc\"))\n" +
|
||||
"\t\treturn engine->outputChannels.enableFan1WithAc;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"hwChannel\"))\n" +
|
||||
"\t\treturn engine->outputChannels.hwChannel;\n" +
|
||||
"\treturn EFI_ERROR_CODE;\n" +
|
||||
|
@ -259,6 +263,8 @@ public class OutputsTest {
|
|||
"\t\treturn config->clt.config.bias_resistor;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"clt.adcChannel\"))\n" +
|
||||
"\t\treturn config->clt.adcChannel;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"issue_294_31\"))\n" +
|
||||
"\t\treturn config->issue_294_31;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"baseFuel\"))\n" +
|
||||
"\t\treturn config->baseFuel;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"afr_type\"))\n" +
|
||||
|
@ -269,6 +275,10 @@ public class OutputsTest {
|
|||
"\t\treturn config->afr_typet;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"vehicleSpeedKph\"))\n" +
|
||||
"\t\treturn config->vehicleSpeedKph;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"isForcedInduction\"))\n" +
|
||||
"\t\treturn config->isForcedInduction;\n" +
|
||||
"\tif (strEqualCaseInsensitive(name, \"enableFan1WithAc\"))\n" +
|
||||
"\t\treturn config->enableFan1WithAc;\n" +
|
||||
"\treturn EFI_ERROR_CODE;\n" +
|
||||
"}\n", getConfigValueConsumer.getGetterForUnitTest());
|
||||
|
||||
|
|
Loading…
Reference in New Issue