This commit is contained in:
bsongis
2014-05-05 10:38:32 +02:00
parent 1466f96e51
commit be3c674fe5
4 changed files with 28 additions and 22 deletions
+4 -3
View File
@@ -126,12 +126,13 @@ extern "C" void TIM3_IRQHandler()
// We process g_ppmInsright here to make servo movement as smooth as possible
// while under trainee control
if ((val>4000) && (val < 19000)) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses)
if (val>4000 && val<19000) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses)
ppmInState = 1; // triggered
}
else {
if (ppmInState && (ppmInState<=16)) {
if ((val>800) && (val<2200)) {
if (ppmInState>0 && ppmInState<=16) {
if (val>800 && val<2200) {
ppmInValid = 100;
g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough.
}
else {