Merge pull request #1564 from blckmn/ppm_fix

PWM fix - and rename SKIP PWM and PPM to USE_PWM and USE_PPM
This commit is contained in:
Martin Budden 2016-11-15 17:11:56 +01:00 committed by GitHub
commit 2805c9596b
9 changed files with 32 additions and 10 deletions

View File

@ -151,8 +151,11 @@ typedef struct master_s {
serialConfig_t serialConfig;
telemetryConfig_t telemetryConfig;
#ifndef SKIP_RX_PWM_PPM
#ifdef USE_PPM
ppmConfig_t ppmConfig;
#endif
#ifdef USE_PWM
pwmConfig_t pwmConfig;
#endif

View File

@ -20,7 +20,7 @@
#include <platform.h>
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
#include "build/build_config.h"
#include "build/debug.h"
@ -408,7 +408,11 @@ void pwmRxInit(const pwmConfig_t *pwmConfig)
IO_t io = IOGetByTag(pwmConfig->ioTags[channel]);
IOInit(io, OWNER_PWMINPUT, RESOURCE_INDEX(channel));
#ifdef STM32F1
IOConfigGPIO(io, IOCFG_IPD);
#else
IOConfigGPIO(io, IOCFG_AF_PP);
#endif
#if defined(USE_HAL_DRIVER)
pwmICConfig(timer->tim, timer->channel, TIM_ICPOLARITY_RISING);
@ -472,7 +476,11 @@ void ppmRxInit(const ppmConfig_t *ppmConfig, uint8_t pwmProtocol)
IO_t io = IOGetByTag(ppmConfig->ioTag);
IOInit(io, OWNER_PPMINPUT, 0);
#ifdef STM32F1
IOConfigGPIO(io, IOCFG_IPD);
#else
IOConfigGPIO(io, IOCFG_AF_PP);
#endif
#if defined(USE_HAL_DRIVER)
pwmICConfig(timer->tim, timer->channel, TIM_ICPOLARITY_RISING);

View File

@ -361,7 +361,7 @@ void resetBeeperConfig(beeperConfig_t *beeperConfig)
}
#endif
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
void resetPpmConfig(ppmConfig_t *ppmConfig)
{
#ifdef PPM_PIN
@ -588,7 +588,7 @@ void createDefaultConfig(master_t *config)
resetBatteryConfig(&config->batteryConfig);
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
resetPpmConfig(&config->ppmConfig);
resetPwmConfig(&config->pwmConfig);
#endif

View File

@ -3763,7 +3763,7 @@ const cliResourceValue_t resourceTable[] = {
#ifdef USE_SERVOS
{ OWNER_SERVO, &masterConfig.servoConfig.ioTags[0], MAX_SUPPORTED_SERVOS },
#endif
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
{ OWNER_PPMINPUT, &masterConfig.ppmConfig.ioTag, 0 },
{ OWNER_PWMINPUT, &masterConfig.pwmConfig.ioTags[0], PWM_INPUT_PORT_COUNT },
#endif

View File

@ -276,7 +276,7 @@ void init(void)
}
#endif
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
if (feature(FEATURE_RX_PPM)) {
ppmRxInit(&masterConfig.ppmConfig, masterConfig.motorConfig.motorPwmProtocol);
} else if (feature(FEATURE_RX_PARALLEL_PWM)) {

View File

@ -23,7 +23,7 @@
#include "platform.h"
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
#include "build/build_config.h"

View File

@ -256,7 +256,7 @@ void rxInit(const rxConfig_t *rxConfig, const modeActivationCondition_t *modeAct
}
#endif
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
if (feature(FEATURE_RX_PPM) || feature(FEATURE_RX_PARALLEL_PWM)) {
rxPwmInit(rxConfig, &rxRuntimeConfig);
}
@ -311,7 +311,7 @@ bool rxUpdateCheck(uint32_t currentTime, uint32_t currentDeltaTime)
}
}
#ifndef SKIP_RX_PWM_PPM
#if defined(USE_PWM) || defined(USE_PPM)
if (feature(FEATURE_RX_PPM)) {
if (isPPMDataBeingReceived()) {
rxSignalReceivedNotDataDriven = true;

View File

@ -91,8 +91,17 @@
//#define TELEMETRY
//#define TELEMETRY_LTM
//#define TELEMETRY_NRF24_LTM
#define SKIP_RX_PWM_PPM
#ifdef USE_PWM
#undef USE_PWM
#endif
#ifdef USE_PPM
#undef USE_PPM
#endif
#ifdef SERIAL_RX
#undef SERIAL_RX
#endif
//#undef SKIP_TASK_STATISTICS
#else

View File

@ -51,6 +51,8 @@
#define USE_SERIALRX_SUMH // Graupner legacy protocol
#define USE_SERIALRX_XBUS // JR
#define USE_CLI
#define USE_PWM
#define USE_PPM
#if defined(STM_FAST_TARGET)
#define MAX_AUX_CHANNELS 99