52,7 → 52,7 |
if((PWMCount) && (PWMCount < 400)) |
{ |
if(PWMCount <9) PWMHeading = 0; |
else PWMHeading = ((uint32_t)(PWMCount - 9) * 1049L) >> 10; // correct timebase and offset |
else PWMHeading = ((uint32_t)(PWMCount - 9) * 1049L)/1024; // correct timebase and offset |
PWMTimeout = 12; // if 12 periodes long no valid PWM was detected the data are invalid |
// 12 * 400 counts * 102.4 us = 419 ms |
} |
68,8 → 68,6 |
{ |
int16_t heading, w, v; |
|
DebugOut.Analog[11] = PWMTimeout; |
|
if(PWMTimeout) |
{ |
w = abs(IntegralPitch / 512); |