Skip to content

Commit 581a454

Browse files
committed
AP_Radio: remove HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
... just use more-specific defines instead
1 parent 8b6ca65 commit 581a454

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

libraries/AP_Radio/AP_Radio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ bool AP_Radio::init(void)
168168
driver = NEW_NOTHROW AP_Radio_beken(*this);
169169
break;
170170
#endif
171-
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
171+
#if AP_RADIO_AUTO_ENABLED
172172
case RADIO_TYPE_AUTO:
173173
// auto-detect between cc2500 and beken radios
174174
#if AP_RADIO_CC2500_ENABLED
@@ -182,7 +182,7 @@ bool AP_Radio::init(void)
182182
}
183183
#endif
184184
break;
185-
#endif // CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
185+
#endif // AP_RADIO_AUTO_ENABLED
186186
default:
187187
break;
188188
}

libraries/AP_Radio/AP_Radio_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121
#ifndef AP_RADIO_BK2425_ENABLED
2222
#define AP_RADIO_BK2425_ENABLED AP_RADIO_BACKEND_DEFAULT_ENABLED
2323
#endif
24+
25+
// tries both CC2500 and BK2425 drivers:
26+
#ifndef AP_RADIO_AUTO_ENABLED
27+
#define AP_RADIO_AUTO_ENABLED 0
28+
#endif // AP_RADIO_AUTO_ENABLED

libraries/AP_Radio/driver_bk2425.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ extern const AP_HAL::HAL& hal;
2020
#include <hal.h>
2121
#endif
2222

23-
// This assumes we are using ChiBios instead of the pixhawk o/s for accessing GPIO
24-
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412
2523
#define BEKEN_SELECT() (dev->set_chip_select(true))
2624
#define BEKEN_DESELECT() (dev->set_chip_select(false))
2725
#define BEKEN_CE_HIGH() (palSetLine(HAL_GPIO_PIN_RADIO_CE)) // (hal.gpio->write(HAL_CHIBIOS_GPIO_RADIO_CE, 1))
2826
#define BEKEN_CE_LOW() (palClearLine(HAL_GPIO_PIN_RADIO_CE)) // (hal.gpio->write(HAL_CHIBIOS_GPIO_RADIO_CE, 0))
2927
#define BEKEN_PA_HIGH() (palSetLine(HAL_GPIO_PIN_RADIO_PA_CTL)) // (hal.gpio->write(HAL_CHIBIOS_GPIO_RADIO_PA_CTL, 1))
3028
#define BEKEN_PA_LOW() (palClearLine(HAL_GPIO_PIN_RADIO_PA_CTL)) // (hal.gpio->write(HAL_CHIBIOS_GPIO_RADIO_PA_CTL, 0))
29+
3130
#if SUPPORT_BK_DEBUG_PINS
3231
#define DEBUG1_HIGH() (palSetLine(HAL_GPIO_PIN_DEBUG1))
3332
#define DEBUG1_LOW() (palClearLine(HAL_GPIO_PIN_DEBUG1))
@@ -39,9 +38,6 @@ extern const AP_HAL::HAL& hal;
3938
#define DEBUG2_HIGH() do {} while (0)
4039
#define DEBUG2_LOW() do {} while (0)
4140
#endif
42-
#else
43-
#error This configuration is not supported.
44-
#endif
4541

4642
// --------------------------------------------------------------------
4743
// Radio initialisation tables

0 commit comments

Comments
 (0)