Removed specifics, and allowed ANY assignment as specified by the user

This commit is contained in:
blckmn 2016-12-08 16:20:59 +11:00
parent 2f83b16860
commit bc43c10473
1 changed files with 2 additions and 6 deletions

View File

@ -103,7 +103,6 @@ typedef struct ppmDevice_s {
ppmDevice_t ppmDev; ppmDevice_t ppmDev;
#define PPM_IN_MIN_SYNC_PULSE_US 2700 // microseconds #define PPM_IN_MIN_SYNC_PULSE_US 2700 // microseconds
#define PPM_IN_MIN_CHANNEL_PULSE_US 750 // microseconds #define PPM_IN_MIN_CHANNEL_PULSE_US 750 // microseconds
#define PPM_IN_MAX_CHANNEL_PULSE_US 2250 // microseconds #define PPM_IN_MAX_CHANNEL_PULSE_US 2250 // microseconds
@ -111,7 +110,6 @@ ppmDevice_t ppmDev;
#define PPM_IN_MIN_NUM_CHANNELS 4 #define PPM_IN_MIN_NUM_CHANNELS 4
#define PPM_IN_MAX_NUM_CHANNELS PWM_PORTS_OR_PPM_CAPTURE_COUNT #define PPM_IN_MAX_NUM_CHANNELS PWM_PORTS_OR_PPM_CAPTURE_COUNT
bool isPPMDataBeingReceived(void) bool isPPMDataBeingReceived(void)
{ {
return (ppmFrameCount != lastPPMFrameCount); return (ppmFrameCount != lastPPMFrameCount);
@ -364,17 +362,15 @@ void pwmICConfig(TIM_TypeDef *tim, uint8_t channel, uint16_t polarity)
TIM_ICInit(tim, &TIM_ICInitStructure); TIM_ICInit(tim, &TIM_ICInitStructure);
} }
#endif #endif
void pwmRxInit(const pwmConfig_t *pwmConfig) void pwmRxInit(const pwmConfig_t *pwmConfig)
{ {
for (int channel = 0; channel < PWM_INPUT_PORT_COUNT; channel++) { for (int channel = 0; channel < PWM_INPUT_PORT_COUNT; channel++) {
pwmInputPort_t *port = &pwmInputPorts[channel]; pwmInputPort_t *port = &pwmInputPorts[channel];
const timerHardware_t *timer = timerGetByTag(pwmConfig->ioTags[channel], TIM_USE_PWM); const timerHardware_t *timer = timerGetByTag(pwmConfig->ioTags[channel], TIM_USE_ANY);
if (!timer) { if (!timer) {
/* TODO: maybe fail here if not enough channels? */ /* TODO: maybe fail here if not enough channels? */
@ -444,7 +440,7 @@ void ppmRxInit(const ppmConfig_t *ppmConfig, uint8_t pwmProtocol)
pwmInputPort_t *port = &pwmInputPorts[FIRST_PWM_PORT]; pwmInputPort_t *port = &pwmInputPorts[FIRST_PWM_PORT];
const timerHardware_t *timer = timerGetByTag(ppmConfig->ioTag, TIM_USE_PPM); const timerHardware_t *timer = timerGetByTag(ppmConfig->ioTag, TIM_USE_ANY);
if (!timer) { if (!timer) {
/* TODO: fail here? */ /* TODO: fail here? */
return; return;