My assumed code for this was
Code: Select all
timer tmr;
unsigned int t;
unsigned int v;
select
{
case p_in when pinsneq(v) :
tmr :> t;
break;
}
I have come across code like this on the forum.
Code: Select all
case p_in when pinsneq(v) :> v@ t:
break;
Or does this time the actual transition?
I have tried running it, and I have found that, the value of t returned by this process is always less than 65536, as if it is using a 1 bit timer. The timer appears to be synced by offset from the system timer.
Code: Select all
select
{
case p_button when pinsneq(button) :> button @ t0:
tmr :> t1;
printf("%x : %8x : %8x : %8x : %8x\n", button, t0, t1, t1-t0, (t1-t0)%65536);
break;
}
Final question.
Where do I find documentation on this?
Because I have only seen the notation rather than read the description, I do not know what search terms to use to get help.