how about this
Code:
//somewhere at the top of user_routines.c
int buttonstate=0;
//then later....
if(buttonstate==0 && p1_sw_trig==1)
{
//do some stuff here
buttonstate=1;
}
if(p1_sw_trig==0)
{
buttonstate=0
}
I am really sleepy and not thinking quite right just now, but that should do sort of a latching thingy. Maybe where it says to put the stuff you could increment another variable then based on the value of that variable decide what to do... something like that.
