//toggle the pin high or low
if(PORTC2)
PORTC &= ~(1<<PORTC2);
else
PORTC |= (1<<PORTC2);
...does not toggle anything.
//toggle the pin high or low
if(PORTC2)
PORTC &= ~(1<<PORTC2);
else
PORTC |= (1<<PORTC2);
...does not toggle anything.