Rev 1763 | Rev 1793 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1763 | Rev 1771 | ||
---|---|---|---|
Line 189... | Line 189... | ||
189 | /*****************************************************/ |
189 | /*****************************************************/ |
Line 190... | Line 190... | ||
190 | 190 | ||
191 | 191 | ||
192 | void CalculateServo(void) |
192 | void CalculateServo(void) |
193 | { |
193 | { |
Line 194... | Line 194... | ||
194 | char cosinus, sinus; |
194 | signed char cosinus, sinus; |
195 | long nick, roll; |
195 | signed long nick, roll; |
Line 196... | Line 196... | ||
196 | 196 | ||
Line 354... | Line 354... | ||
354 | TCCR2A |= (1<<COM2A0); // make a low pulse |
354 | TCCR2A |= (1<<COM2A0); // make a low pulse |
355 | // set pulsewidth to stop pulse width |
355 | // set pulsewidth to stop pulse width |
356 | RemainingPulse = PPM_STOPPULSE; |
356 | RemainingPulse = PPM_STOPPULSE; |
357 | // accumulate time for correct sync gap |
357 | // accumulate time for correct sync gap |
358 | ServoFrameTime += RemainingPulse; |
358 | ServoFrameTime += RemainingPulse; |
359 | if((ServoActive && SenderOkay > 180) || ServoActive == 2) HEF4017R_OFF; // disable HEF4017 reset |
359 | if((ServoActive && SenderOkay > 50) || ServoActive == 2) HEF4017R_OFF; // disable HEF4017 reset |
360 | else HEF4017R_ON; |
360 | else HEF4017R_ON; |
361 | ServoIndex++; // change to next servo channel |
361 | ServoIndex++; // change to next servo channel |
362 | if(ServoIndex > EE_Parameter.ServoNickRefresh) |
362 | if(ServoIndex > EE_Parameter.ServoNickRefresh) |
363 | { |
363 | { |
364 | CalculateServoSignals = 1; |
364 | CalculateServoSignals = 1; |