I found this in a source file I was looking at for a navigation system for an RC plane. What is the "ISR(PCINT2_vect) {"? Is it a function?... and if so what is the significance of having just a single type in the parameters?
Code:
#if RADIO_TYPE == 0
ISR(PCINT2_vect) {
int cnt = TCNT1;
if(PIND & B00000100){ // ch 1 (pin 2) is high
ch1_read = 1;
timer1count = cnt;
}else if (ch1_read == 1){ // ch 1 (pin 2) is Low
ch1_read = 0;
if (cnt < timer1count) // Timer1 reset during the read of this pulse
timer1diff = (cnt + 40000 - timer1count); // Timer1 TOP = 40000
else
timer1diff = (cnt - timer1count);
}
if(PIND & B00001000){ // ch 1 (pin 2) is high
ch2_read = 1;
timer2count = cnt;
}else if (ch2_read == 1){ // ch 1 (pin 2) is Low
ch2_read = 0;
if (cnt < timer2count) // Timer1 reset during the read of this pulse
timer2diff = (cnt + 40000 - timer2count); // Timer1 TOP = 40000
else
timer2diff = (cnt - timer2count);
}
}
ISR(PCINT0_vect)
{
int cnt = TCNT1;
if(PINB & B00100000){
timer3count = cnt;
}else{
if (cnt < timer3count) // Timer1 reset during the read of this pulse
timer3diff = (cnt + 40000 - timer3count); // Timer1 TOP = 40000
else
timer3diff = (cnt - timer3count);
}
}
#endif