APM_RC: fixed noisy PWM output on startup for APM2
This reduces the number of rubbish pulses on the APM2 PWM output pins
on startup, which should help with booting some cheaper ESCs.
Thanks to Randy for the idea!
mission-4.1.18
Craig Elder13 years agocommitted byAndrew Tridgell
// --------------------- TIMER1: OUT1 and OUT2 -----------------------
digitalWrite(12,HIGH);// pulling high before changing to output avoids a momentary drop of the pin to low because the ESCs have a pull-down resistor it seems
digitalWrite(11,HIGH);
pinMode(12,OUTPUT);// OUT1 (PB6/OC1B)
pinMode(11,OUTPUT);// OUT2 (PB5/OC1A)
digitalWrite(12,HIGH);// pulling high before changing to output avoids a momentary drop of the pin to low because the ESCs have a pull-down resistor it seems
digitalWrite(11,HIGH);
// WGM: 1 1 1 0. Clear Timer on Compare, TOP is ICR1.