2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
24 #include "build_config.h"
28 #include "drivers/gpio.h"
29 #include "drivers/timer.h"
30 #include "drivers/pwm_rx.h"
32 #include "config/config.h"
37 static uint16_t pwmReadRawRC(rxRuntimeConfig_t
*rxRuntimeConfigPtr
, uint8_t channel
)
39 UNUSED(rxRuntimeConfigPtr
);
40 return pwmRead(channel
);
43 static uint16_t ppmReadRawRC(rxRuntimeConfig_t
*rxRuntimeConfigPtr
, uint8_t channel
)
45 UNUSED(rxRuntimeConfigPtr
);
46 return ppmRead(channel
);
49 void rxPwmInit(rxRuntimeConfig_t
*rxRuntimeConfigPtr
, rcReadRawDataPtr
*callback
)
51 UNUSED(rxRuntimeConfigPtr
);
52 // configure PWM/CPPM read function and max number of channels. serial rx below will override both of these, if enabled
53 /*if (feature(FEATURE_RX_PARALLEL_PWM)) {
54 rxRuntimeConfigPtr->channelCount = MAX_SUPPORTED_RC_PARALLEL_PWM_CHANNEL_COUNT;
55 *callback = pwmReadRawRC;
57 if (feature(FEATURE_RX_PPM)) {*/
58 rxRuntimeConfigPtr
->channelCount
= MAX_SUPPORTED_RC_PPM_CHANNEL_COUNT
;
59 *callback
= ppmReadRawRC
;