mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Fixed runtime configuration for CC2500 SPI RX.
This commit is contained in:
parent
f7f0c67808
commit
84a6bd36d8
2 changed files with 7 additions and 5 deletions
|
@ -31,6 +31,12 @@
|
|||
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(rxCc2500SpiConfig_t, rxCc2500SpiConfig, PG_RX_CC2500_SPI_CONFIG, 1);
|
||||
|
||||
#if defined(RX_CC2500_SPI_DISABLE_CHIP_DETECTION)
|
||||
#define CC2500_SPI_CHIP_DETECTION false
|
||||
#else
|
||||
#define CC2500_SPI_CHIP_DETECTION true
|
||||
#endif
|
||||
|
||||
PG_RESET_TEMPLATE(rxCc2500SpiConfig_t, rxCc2500SpiConfig,
|
||||
.autoBind = false,
|
||||
.bindTxId = {0, 0},
|
||||
|
@ -41,7 +47,7 @@ PG_RESET_TEMPLATE(rxCc2500SpiConfig_t, rxCc2500SpiConfig,
|
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
.rxNum = 0,
|
||||
.a1Source = FRSKY_SPI_A1_SOURCE_VBAT,
|
||||
.chipDetectEnabled = true,
|
||||
.chipDetectEnabled = CC2500_SPI_CHIP_DETECTION,
|
||||
.txEnIoTag = IO_TAG(RX_CC2500_SPI_TX_EN_PIN),
|
||||
.lnaEnIoTag = IO_TAG(RX_CC2500_SPI_LNA_EN_PIN),
|
||||
.antSelIoTag = IO_TAG(RX_CC2500_SPI_ANT_SEL_PIN),
|
||||
|
|
|
@ -118,13 +118,9 @@ static bool cc2500SpiDetect(void)
|
|||
|
||||
bool cc2500SpiInit(void)
|
||||
{
|
||||
#if !defined(RX_CC2500_SPI_DISABLE_CHIP_DETECTION)
|
||||
if (rxCc2500SpiConfig()->chipDetectEnabled && !cc2500SpiDetect()) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
UNUSED(cc2500SpiDetect);
|
||||
#endif
|
||||
|
||||
// gpio init here
|
||||
gdoPin = IOGetByTag(rxSpiConfig()->extiIoTag);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue