2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #if defined(USE_RX_BIND)
25 #include "rx/rx_spi_common.h"
30 static bool doRxBind(bool doBind
)
32 switch (rxRuntimeState
.rxProvider
) {
35 case RX_PROVIDER_SERIAL
:
36 switch (rxRuntimeState
.serialrxProvider
) {
39 #if defined(USE_SERIALRX_SRXL2)
50 #if defined(USE_RX_SPI)
52 switch (rxSpiConfig()->rx_spi_protocol
) {
55 #if defined(USE_RX_FRSKY_SPI)
56 #if defined(USE_RX_FRSKY_SPI_D)
59 #if defined(USE_RX_FRSKY_SPI_X)
61 case RX_SPI_FRSKY_X_LBT
:
63 #endif // USE_RX_FRSKY_SPI
64 #ifdef USE_RX_SFHSS_SPI
68 case RX_SPI_A7105_FLYSKY
:
69 case RX_SPI_A7105_FLYSKY_2A
:
71 #ifdef USE_RX_SPEKTRUM
72 case RX_SPI_CYRF6936_DSM
:
74 #if defined(USE_RX_FRSKY_SPI) || defined(USE_RX_SFHSS_SPI) || defined(USE_RX_FLYSKY) || defined(USE_RX_SPEKTRUM)
90 bool startRxBind(void)
92 return doRxBind(true);
95 bool getRxBindSupported(void)
97 return doRxBind(false);