mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Bind IO fix
This commit is contained in:
parent
1d99d8a0d6
commit
9f35b6939c
@ -122,6 +122,11 @@ static int32_t PIOS_SPEKTRUM_Get(uint32_t rcvr_id, uint8_t channel)
|
||||
*/
|
||||
static bool PIOS_SPEKTRUM_Bind(const struct pios_spektrum_cfg * cfg, uint8_t bind)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = cfg->bind.init.GPIO_Pin;
|
||||
GPIO_InitStructure.GPIO_Speed = cfg->bind.init.GPIO_Speed;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
|
||||
|
||||
/* just to limit bind pulses */
|
||||
bind=(bind<=10)?bind:10;
|
||||
|
||||
@ -141,6 +146,7 @@ static bool PIOS_SPEKTRUM_Bind(const struct pios_spektrum_cfg * cfg, uint8_t bin
|
||||
PIOS_DELAY_WaituS(120);
|
||||
}
|
||||
/* RX line, set input and wait for data, PIOS_SPEKTRUM_Init */
|
||||
GPIO_Init(cfg->bind.gpio, &GPIO_InitStructure);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user