Skip to content

Commit

Permalink
Merge pull request #4021 from iNavFlight/de_ppm
Browse files Browse the repository at this point in the history
Fix non-working PPM; Enable PPM on OMNIBUSF7 NXT
  • Loading branch information
digitalentity committed Nov 18, 2018
2 parents 2348e0d + 9030a9f commit cf56e08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/drivers/rx_pwm.c
Expand Up @@ -362,6 +362,7 @@ void pwmInConfig(const timerHardware_t *timerHardwarePtr, uint8_t channel)
timerChInitCallbacks(&self->cb, (void*)self, &pwmEdgeCallback, &pwmOverflowCallback);
timerChConfigCallbacks(tch, &self->cb);
timerChConfigIC(tch, true, INPUT_FILTER_TICKS);
timerChCaptureEnable(tch);
}

#define UNUSED_PPM_TIMER_REFERENCE 0
Expand All @@ -388,6 +389,7 @@ void ppmInConfig(const timerHardware_t *timerHardwarePtr)
timerChInitCallbacks(&self->cb, (void*)self, &ppmEdgeCallback, &ppmOverflowCallback);
timerChConfigCallbacks(tch, &self->cb);
timerChConfigIC(tch, true, INPUT_FILTER_TICKS);
timerChCaptureEnable(tch);
}

uint16_t ppmRead(uint8_t channel)
Expand Down
1 change: 1 addition & 0 deletions src/main/rx/pwm.c
Expand Up @@ -25,6 +25,7 @@

#if defined(USE_RX_PWM) || defined(USE_RX_PPM)

#include "build/debug.h"
#include "common/utils.h"

#include "config/feature.h"
Expand Down
6 changes: 3 additions & 3 deletions src/main/target/OMNIBUSF7NXT/target.c
Expand Up @@ -35,7 +35,7 @@ BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS,
BUSDEV_REGISTER_SPI_TAG(busdev_mpu6500, DEVHW_MPU6500, MPU6500_SPI_BUS, MPU6500_CS_PIN, NONE, 1, DEVFLAGS_NONE);

const timerHardware_t timerHardware[] = {
// DEF_TIM(TIM10, CH1, PB8, TIM_USE_PPM, 0), // PPM
DEF_TIM(TIM4, CH2, PB7, TIM_USE_PPM, 0, 0), // PPM / UART1_RX

// OUTPUT 1-4
DEF_TIM(TIM3, CH2, PB5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 1, 0),
Expand All @@ -48,8 +48,8 @@ const timerHardware_t timerHardware[] = {
DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 1, 0),

// AUXILARY pins
DEF_TIM(TIM1, CH2, PA9, TIM_USE_LED, 1, 0), // LED
DEF_TIM(TIM4, CH1, PB6, TIM_USE_ANY, 0, 0) // SS1 TX
DEF_TIM(TIM1, CH2, PA9, TIM_USE_LED, 1, 0), // LED
DEF_TIM(TIM4, CH1, PB6, TIM_USE_ANY, 0, 0) // SS1 TX / UART1_TX
};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

0 comments on commit cf56e08

Please sign in to comment.