So sollte es ja dann gehen:
Code:
void int_sum(void) {
if (PIN_READ_SUM) { // positive edge
sum_pulse = micros() - sum_start; // calculate pulsewidth
sum_start = micros(); // restart
if (sum_pulse > 3000 || sum_nr > 14)
sum_nr = 1;
else {
if (sum_nr == SUM_CH_THROTTLE)
throttle_pulse = sum_pulse;
else if (sum_nr == SUM_CH_SCREENSWITCH)
screenswitch_pulse = sum_pulse;
sum_nr++;
}
}
}
Tschö
JR