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
+6 -7
View File
@@ -314,15 +314,14 @@ extern "C" void TC3_IRQHandler() //capture ppm in at 2MHz
ppmInState = 1; // triggered
}
else {
if (ppmInState && ppmInState<=16)
{
if (val>800 && val<2200) // if valid pulse-width range
{
g_ppmIns[ppmInState++ - 1] =
(int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough.
if (ppmInState>0 && ppmInState<=16) {
if (val>800 && val<2200) { // if valid pulse-width range
ppmInValid = 100;
g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough.
}
else
else {
ppmInState = 0; // not triggered
}
}
}