New parser writes output channel c structs (#350)

* new parser writes c structs

* jar

* missing defs for simulator

* don't put defines you need in live data txt
This commit is contained in:
Matthew Kennedy 2024-01-19 04:00:59 -08:00 committed by GitHub
parent 5dc0a2a167
commit 76708670a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 9 deletions

View File

@ -7,10 +7,11 @@
#pragma once
#include <string.h>
#include <cstring>
#include <stdbool.h>
#include <float.h>
#include <stdint.h>
#include <cstdint>
#include <cstddef>
#if defined __GNUC__
// GCC
#include <sys/types.h>

View File

@ -1,4 +1,3 @@
#define HW_EVENT_TYPES 6
struct_no_prefix trigger_central_s

View File

@ -99,6 +99,7 @@ Usages:
folder: controllers/trigger
withCDefines: true
constexpr: "engine->triggerCentral"
prepend: integration/rusefi_config_shared.txt
conditional_compilation: "EFI_SHAFT_POSITION_INPUT"
- name: trigger_state

View File

@ -33,6 +33,7 @@
#define BOOST_BLEND_COUNT 2
#define LUA_GAUGE_COUNT 2
#define HW_EVENT_TYPES 6
#define GAUGE_NAME_VERSION "firmware"
#define GAUGE_NAME_UPTIME "Uptime"

Binary file not shown.

View File

@ -6,6 +6,7 @@ import com.rusefi.InvokeReader;
import com.rusefi.ReaderStateImpl;
import com.rusefi.RusefiParseErrorStrategy;
import com.rusefi.newparse.ParseState;
import com.rusefi.newparse.outputs.CStructWriter;
import com.rusefi.newparse.parsing.Definition;
import com.rusefi.output.*;
import com.rusefi.util.LazyFile;
@ -120,13 +121,12 @@ public class LiveDataProcessor {
state.addPrepend(extraPrepend);
state.addPrepend(prepend);
String cHeaderDestination = folder + File.separator + name + "_generated.h";
state.addCHeaderDestination(cHeaderDestination);
int baseOffset = outputsSections.getBaseOffset();
if (javaName != null) {
state.addDestination(new FileJavaFieldsConsumer(state, "../java_console/models/src/main/java/com/rusefi/config/generated/" + javaName, baseOffset));
}
if (javaName != null) {
state.addDestination(new FileJavaFieldsConsumer(state, "../java_console/models/src/main/java/com/rusefi/config/generated/" + javaName, baseOffset));
}
if (constexpr != null) {
sdCardFieldsConsumer.home = constexpr;
@ -151,8 +151,8 @@ public class LiveDataProcessor {
RusefiParseErrorStrategy.parseDefinitionFile(parseState.getListener(), state.getDefinitionInputFile());
// CStructWriter cStructs = new CStructWriter();
// cStructs.writeCStructs(parseState, cHeaderDestination);
CStructWriter cStructs = new CStructWriter();
cStructs.writeCStructs(parseState, cHeaderDestination);
// if (outputNames.length == 0) {
// outputChannelWriter.writeOutputChannels(parseState, null);

Binary file not shown.