From 3aaaa3f9f5460d8dcc4348e1db218bb3198dad02 Mon Sep 17 00:00:00 2001 From: Michael Jakob Date: Sat, 29 Nov 2014 14:43:03 +0100 Subject: [PATCH] Updates and fixes fix FEATURE_RX_SERIAL Delay for the hardware bind plug Bind code will only work on default NAZE serial port (document limitation) --- src/main/main.c | 2 +- src/main/rx/spektrum.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/main.c b/src/main/main.c index bfe46347e..36a1a3c45 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -151,7 +151,7 @@ void init(void) systemInit(); // Spektrum sattelite bind - ported from Baseflight - if (feature(FEATURE_RX_MSP)) { + if (feature(FEATURE_RX_SERIAL)) { switch (masterConfig.rxConfig.serialrx_provider) { case SERIALRX_SPEKTRUM1024: case SERIALRX_SPEKTRUM2048: diff --git a/src/main/rx/spektrum.c b/src/main/rx/spektrum.c index 146de97b3..2c2aac6b1 100644 --- a/src/main/rx/spektrum.c +++ b/src/main/rx/spektrum.c @@ -151,6 +151,7 @@ uint32_t rccReadBkpDr(void) /* spektrumBind function ported from Baseflight. It's used to bind satellite receiver to TX. * Function must be called immediately after startup so that we don't miss satellite bind window. + * It will only work for USART2, PA3 pin. * Known parameters. Tested with DSMX satellite and DX8 radio. Framerate (11ms or 22ms) must be selected from TX. * 9 = DSMX 11ms / DSMX 22ms * 5 = DSM2 11ms 2048 / DSM2 22ms 1024 @@ -173,6 +174,7 @@ void spektrumBind(rxConfig_t *rxConfig) gpio.pin = hwBindPin; gpio.mode = Mode_IPU; gpioInit(hwBindPort, &gpio); + delayMicroseconds(10); // allow configuration to settle if (digitalIn(hwBindPort, hwBindPin)) return; #endif