forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logicdata_sandbox.cpp
39 lines (31 loc) · 1.13 KB
/
logicdata_sandbox.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @file logicdata_sandbox.cpp
*
*/
#include <cstdio>
#include "logicdata.h"
static CompositeEvent events[100];
static void setEvent(CompositeEvent *events, int index,
int timestamp, bool primaryTrigger, bool secondaryTrigger, bool isTDC, bool sync, bool coil, bool injector) {
events[index].timestamp = timestamp;
events[index].primaryTrigger = primaryTrigger;
events[index].secondaryTrigger = secondaryTrigger;
events[index].isTDC = isTDC;
events[index].sync = sync;
events[index].coil = coil;
events[index].injector = injector;
}
void runLogicdataSandbox() {
printf(".logicdata Sandbox 20200719\n");
int index = 0;
setEvent(events, index++, 10, false, false, false, false, false, false);
setEvent(events, index++, 20, true, false, true, false, false, false);
setEvent(events, index++, 30, false, false, false, false, false, false);
setEvent(events, index++, 1000030, false, false, false, false, true, false);
setEvent(events, index++, 2000030, false, false, true, false, false, true);
writeFile("test.logicdata", events, index);
printf("Done!\n");
}
int main(int argc, char **argv) {
runLogicdataSandbox();
}