mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 10:10:34 +08:00
kinetis: fix PPM decoding
On kinetis, the TPM_STATUS_TOF was used to detect missed interrupts for PPM decoding. However this was not correct, because the TOF bit was set on each timer overflow. This happened regularly after every 64ms interval, which meant that most PPM frames were just discarded. I have not found any equivalent register/solution that is used on STMF4, so this just removes the TOF handling. However there is now no way to detect missed edges/interrupts!
This commit is contained in:
@@ -346,11 +346,6 @@ static void hrt_ppm_decode(uint32_t status)
|
||||
uint16_t interval;
|
||||
unsigned i;
|
||||
|
||||
/* if we missed an edge, we have to give up */
|
||||
if (status & TPM_STATUS_TOF) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* how long since the last edge? - this handles counter wrapping implicitly. */
|
||||
width = count - ppm.last_edge;
|
||||
|
||||
@@ -510,7 +505,7 @@ hrt_tim_isr(int irq, void *context, void *arg)
|
||||
#ifdef HRT_PPM_CHANNEL
|
||||
|
||||
/* was this a PPM edge? */
|
||||
if (status & (STATUS_PPM | TPM_STATUS_TOF)) {
|
||||
if (status & (STATUS_PPM)) {
|
||||
hrt_ppm_decode(status);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user