remove define_constructor (#3640)

* no define_constructor

* jar

* sim needs live doc
This commit is contained in:
Matthew Kennedy 2021-11-30 16:31:54 -08:00 committed by GitHub
parent 4f2b50b8d4
commit 890cbd8cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 26 deletions

View File

@ -30,6 +30,10 @@ jobs:
run: |
bash gen_enum_to_string.sh
- name: Generate Live Documentation
working-directory: ./firmware/
run: bash gen_live_documentation.sh
- name: Compile Simulator
working-directory: ./simulator/
run: bash compile.sh

View File

@ -38,15 +38,13 @@ WaveChart waveChart;
static scheduling_s debugToggleScheduling;
#define DEBUG_PIN_DELAY US2NT(60)
trigger_central_s::trigger_central_s() : hwEventCounters() {
}
TriggerCentral::TriggerCentral() : trigger_central_s(),
TriggerCentral::TriggerCentral() :
vvtEventRiseCounter(),
vvtEventFallCounter(),
vvtPosition(),
vvtSyncTimeNt()
{
memset(&hwEventCounters, 0, sizeof(hwEventCounters));
triggerState.resetTriggerState();
noiseFilter.resetAccumSignalData();
}

View File

@ -1,6 +1,6 @@
#define HW_EVENT_TYPES 6
struct_no_prefix define_constructor trigger_central_s
struct_no_prefix trigger_central_s
int[HW_EVENT_TYPES iterate] hwEventCounters;Counter of hardware events since ECU start

Binary file not shown.

View File

@ -27,7 +27,6 @@ public class ReaderState {
private static final String END_STRUCT = "end_struct";
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
private static final String STRUCT = "struct ";
private static final String DEFINE_CONSTRUCTOR = "define_constructor";
public final Stack<ConfigStructure> stack = new Stack<>();
public final Map<String, Integer> tsCustomSize = new HashMap<>();
public final Map<String, String> tsCustomLine = new HashMap<>();
@ -221,15 +220,6 @@ public class ReaderState {
}
private static void handleStartStructure(ReaderState state, String line, boolean withPrefix) {
boolean withConstructor;
if (line.toLowerCase().startsWith(DEFINE_CONSTRUCTOR)) {
withConstructor = true;
line = line.substring(DEFINE_CONSTRUCTOR.length()).trim();
} else {
withConstructor = false;
}
String name;
String comment;
if (line.contains(" ")) {
@ -240,7 +230,7 @@ public class ReaderState {
name = line;
comment = null;
}
ConfigStructure structure = new ConfigStructure(name, comment, withPrefix, withConstructor);
ConfigStructure structure = new ConfigStructure(name, comment, withPrefix);
state.stack.push(structure);
SystemOut.println("Starting structure " + structure.getName());
}

View File

@ -45,9 +45,6 @@ public abstract class BaseCHeaderConsumer implements ConfigurationConsumer {
content.append("// start of " + structure.name + EOL);
content.append("struct " + structure.name + " {" + EOL);
if (structure.isWithConstructor()) {
content.append("\t" + structure.name + "();" + EOL);
}
int currentOffset = 0;

View File

@ -24,7 +24,6 @@ public class ConfigStructure {
public final String name;
public final String comment;
public final boolean withPrefix;
private final boolean withConstructor;
/**
* We have two different collections because if 'array iterate' feature which is handled differently
* in C and TS
@ -39,11 +38,10 @@ public class ConfigStructure {
private ConfigField cPrevField = ConfigField.VOID;
private final Set<String> names = new HashSet<>();
public ConfigStructure(String name, String comment, boolean withPrefix, boolean withConstructor) {
public ConfigStructure(String name, String comment, boolean withPrefix) {
this.name = name;
this.comment = comment;
this.withPrefix = withPrefix;
this.withConstructor = withConstructor;
}
public void addBitField(ConfigField bitField) {
@ -51,10 +49,6 @@ public class ConfigStructure {
this.readingBitState.incrementBitIndex(bitField);
}
public boolean isWithConstructor() {
return withConstructor;
}
public String getName() {
return name;
}