diff options
| author | iabdalkader <i.abdalkader@gmail.com> | 2021-04-28 20:09:34 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-04-30 10:15:59 +1000 |
| commit | d74e2aca3e30ff1d424e97ac0d37d07694d69b7d (patch) | |
| tree | b9a335f6a91c0877013a962ea3b044abc58538b6 | |
| parent | d3eb6d68a377c42bd37e609ce667bea815fecd4f (diff) | |
drivers/cyw43/cywbt: Add compile option for RF switch.
| -rw-r--r-- | drivers/cyw43/cywbt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cyw43/cywbt.c b/drivers/cyw43/cywbt.c index defe67068..c4fecca81 100644 --- a/drivers/cyw43/cywbt.c +++ b/drivers/cyw43/cywbt.c @@ -149,10 +149,14 @@ STATIC int cywbt_download_firmware(const uint8_t *firmware) { } // RF switch must select high path during BT patch boot + #if MICROPY_HW_ENABLE_RF_SWITCH mp_hal_pin_config(pyb_pin_WL_GPIO_1, MP_HAL_PIN_MODE_INPUT, MP_HAL_PIN_PULL_UP, 0); + #endif mp_hal_delay_ms(10); // give some time for CTS to go high cywbt_wait_cts_low(); + #if MICROPY_HW_ENABLE_RF_SWITCH mp_hal_pin_config(pyb_pin_WL_GPIO_1, MP_HAL_PIN_MODE_INPUT, MP_HAL_PIN_PULL_DOWN, 0); // Select chip antenna (could also select external) + #endif mp_bluetooth_hci_uart_set_baudrate(115200); cywbt_set_baudrate(3000000); @@ -170,9 +174,11 @@ int mp_bluetooth_hci_controller_init(void) { mp_hal_pin_output(pyb_pin_BT_DEV_WAKE); mp_hal_pin_low(pyb_pin_BT_DEV_WAKE); + #if MICROPY_HW_ENABLE_RF_SWITCH // TODO don't select antenna if wifi is enabled mp_hal_pin_config(pyb_pin_WL_GPIO_4, MP_HAL_PIN_MODE_OUTPUT, MP_HAL_PIN_PULL_NONE, 0); // RF-switch power mp_hal_pin_high(pyb_pin_WL_GPIO_4); // Turn the RF-switch on + #endif uint8_t buf[256]; |
