remove define_constructor (#3640)
* no define_constructor * jar * sim needs live doc
This commit is contained in:
parent
4f2b50b8d4
commit
890cbd8cf2
|
@ -30,6 +30,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
bash gen_enum_to_string.sh
|
bash gen_enum_to_string.sh
|
||||||
|
|
||||||
|
- name: Generate Live Documentation
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: bash gen_live_documentation.sh
|
||||||
|
|
||||||
- name: Compile Simulator
|
- name: Compile Simulator
|
||||||
working-directory: ./simulator/
|
working-directory: ./simulator/
|
||||||
run: bash compile.sh
|
run: bash compile.sh
|
||||||
|
|
|
@ -38,15 +38,13 @@ WaveChart waveChart;
|
||||||
static scheduling_s debugToggleScheduling;
|
static scheduling_s debugToggleScheduling;
|
||||||
#define DEBUG_PIN_DELAY US2NT(60)
|
#define DEBUG_PIN_DELAY US2NT(60)
|
||||||
|
|
||||||
trigger_central_s::trigger_central_s() : hwEventCounters() {
|
TriggerCentral::TriggerCentral() :
|
||||||
}
|
|
||||||
|
|
||||||
TriggerCentral::TriggerCentral() : trigger_central_s(),
|
|
||||||
vvtEventRiseCounter(),
|
vvtEventRiseCounter(),
|
||||||
vvtEventFallCounter(),
|
vvtEventFallCounter(),
|
||||||
vvtPosition(),
|
vvtPosition(),
|
||||||
vvtSyncTimeNt()
|
vvtSyncTimeNt()
|
||||||
{
|
{
|
||||||
|
memset(&hwEventCounters, 0, sizeof(hwEventCounters));
|
||||||
triggerState.resetTriggerState();
|
triggerState.resetTriggerState();
|
||||||
noiseFilter.resetAccumSignalData();
|
noiseFilter.resetAccumSignalData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define HW_EVENT_TYPES 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
|
int[HW_EVENT_TYPES iterate] hwEventCounters;Counter of hardware events since ECU start
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -27,7 +27,6 @@ public class ReaderState {
|
||||||
private static final String END_STRUCT = "end_struct";
|
private static final String END_STRUCT = "end_struct";
|
||||||
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
|
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
|
||||||
private static final String STRUCT = "struct ";
|
private static final String STRUCT = "struct ";
|
||||||
private static final String DEFINE_CONSTRUCTOR = "define_constructor";
|
|
||||||
public final Stack<ConfigStructure> stack = new Stack<>();
|
public final Stack<ConfigStructure> stack = new Stack<>();
|
||||||
public final Map<String, Integer> tsCustomSize = new HashMap<>();
|
public final Map<String, Integer> tsCustomSize = new HashMap<>();
|
||||||
public final Map<String, String> tsCustomLine = 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) {
|
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 name;
|
||||||
String comment;
|
String comment;
|
||||||
if (line.contains(" ")) {
|
if (line.contains(" ")) {
|
||||||
|
@ -240,7 +230,7 @@ public class ReaderState {
|
||||||
name = line;
|
name = line;
|
||||||
comment = null;
|
comment = null;
|
||||||
}
|
}
|
||||||
ConfigStructure structure = new ConfigStructure(name, comment, withPrefix, withConstructor);
|
ConfigStructure structure = new ConfigStructure(name, comment, withPrefix);
|
||||||
state.stack.push(structure);
|
state.stack.push(structure);
|
||||||
SystemOut.println("Starting structure " + structure.getName());
|
SystemOut.println("Starting structure " + structure.getName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,6 @@ public abstract class BaseCHeaderConsumer implements ConfigurationConsumer {
|
||||||
|
|
||||||
content.append("// start of " + structure.name + EOL);
|
content.append("// start of " + structure.name + EOL);
|
||||||
content.append("struct " + structure.name + " {" + EOL);
|
content.append("struct " + structure.name + " {" + EOL);
|
||||||
if (structure.isWithConstructor()) {
|
|
||||||
content.append("\t" + structure.name + "();" + EOL);
|
|
||||||
}
|
|
||||||
|
|
||||||
int currentOffset = 0;
|
int currentOffset = 0;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ public class ConfigStructure {
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String comment;
|
public final String comment;
|
||||||
public final boolean withPrefix;
|
public final boolean withPrefix;
|
||||||
private final boolean withConstructor;
|
|
||||||
/**
|
/**
|
||||||
* We have two different collections because if 'array iterate' feature which is handled differently
|
* We have two different collections because if 'array iterate' feature which is handled differently
|
||||||
* in C and TS
|
* in C and TS
|
||||||
|
@ -39,11 +38,10 @@ public class ConfigStructure {
|
||||||
private ConfigField cPrevField = ConfigField.VOID;
|
private ConfigField cPrevField = ConfigField.VOID;
|
||||||
private final Set<String> names = new HashSet<>();
|
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.name = name;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
this.withPrefix = withPrefix;
|
this.withPrefix = withPrefix;
|
||||||
this.withConstructor = withConstructor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBitField(ConfigField bitField) {
|
public void addBitField(ConfigField bitField) {
|
||||||
|
@ -51,10 +49,6 @@ public class ConfigStructure {
|
||||||
this.readingBitState.incrementBitIndex(bitField);
|
this.readingBitState.incrementBitIndex(bitField);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWithConstructor() {
|
|
||||||
return withConstructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue