Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-working PPM; Enable PPM on OMNIBUSF7 NXT #4021

Merged
merged 1 commit into from Nov 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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]);