To fix your code, you also need to make sure that you only process the change once each time the switch is activated.
Code:
last_trig = 0;
...
if (p3_sw_trig ==1 && last_trig == 0 && pnu == 0)
{
...
pnu += 1;
}
if (p3_sw_trig == 1 && last_trig == 0 && pnu == 1)
{
...
pnu = 0;
}
last_trig = p3_sw_trig;