mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Spektrum Satelitte bind code ported from Baseflight
includes support for a hardware bind plug (PB5 pin 41) Activate via OPTIONS="HARDWARE_BIND_PLUG" during make
This commit is contained in:
parent
dd54a59991
commit
c80090f39f
6 changed files with 94 additions and 1 deletions
|
@ -105,7 +105,7 @@ void imuInit(void);
|
|||
void displayInit(rxConfig_t *intialRxConfig);
|
||||
void ledStripInit(ledConfig_t *ledConfigsToUse, hsvColor_t *colorsToUse, failsafe_t* failsafeToUse);
|
||||
void loop(void);
|
||||
|
||||
void spektrumBind(rxConfig_t *rxConfig);
|
||||
|
||||
#ifdef STM32F303xC
|
||||
// from system_stm32f30x.c
|
||||
|
@ -150,6 +150,19 @@ void init(void)
|
|||
|
||||
systemInit();
|
||||
|
||||
// Spektrum sattelite bind - ported from Baseflight
|
||||
if (feature(FEATURE_RX_MSP)) {
|
||||
switch (masterConfig.rxConfig.serialrx_provider) {
|
||||
case SERIALRX_SPEKTRUM1024:
|
||||
case SERIALRX_SPEKTRUM2048:
|
||||
// Spektrum satellite binding if enabled on startup.
|
||||
// Must be called before that 100ms sleep so that we don't lose satellite's binding window after startup.
|
||||
// The rest of Spektrum initialization will happen later - via spektrumInit()
|
||||
spektrumBind(&masterConfig.rxConfig);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
delay(100);
|
||||
|
||||
timerInit(); // timer must be initialized before any channel is allocated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue