bool32.risingfalling start counting,output the time interval
int32 time interval in k-rate ticks (0.333ms)
int32_t trigstart;
int32_t trigstop;
int tc;
int t;
int o;
int ntrig;
int latch;
trigstart = 0;
trigstop = 0;
tc = 0;
t = 0;
o = 0;
if ((inlet_toggle) && !trigstart) {
tc = 0;
trigstart = 1;
} else if (!(inlet_toggle)) {
trigstart = 0;
t = tc;
}
if (trigstart) {
tc == tc++;
t = 0;
}
o = (t == 0) ? 0 : 1;
if ((o > 0) && !ntrig) {
latch = t;
ntrig = 1;
}
if (!(o > 0))
ntrig = 0;
outlet_t = latch;