Skip to content

Commit

Permalink
Merge branch 'bugfix/missing_controller_disabled_guard_v5.2' into 're…
Browse files Browse the repository at this point in the history
…lease/v5.2'

fix(nimble): Fixes related to nimble host only (v5.2)

See merge request espressif/esp-idf!29138
  • Loading branch information
rahult-github committed Feb 21, 2024
2 parents 34ec96e + 821185d commit a707ab9
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 12 deletions.
69 changes: 67 additions & 2 deletions components/bt/host/nimble/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -935,17 +935,82 @@ menu "Host-controller Transport"
help
Use UART transport

config BT_NIMBLE_TRANSPORT_UART_PORT
int "Uart port"
depends on BT_CONTROLLER_DISABLED && BT_NIMBLE_TRANSPORT_UART
default 1
help
Uart port

choice BT_NIMBLE_USE_HCI_UART_PARITY
prompt "Uart PARITY"
default UART_PARITY_NONE
help
Uart Parity

config UART_PARITY_NONE
bool "None"
config UART_PARITY_ODD
bool "Odd"
config UART_PARITY_EVEN
bool "Even"
endchoice

config BT_NIMBLE_TRANSPORT_UART_PARITY_NONE
int
default 0 if !UART_PARITY_NONE
default 1 if UART_PARITY_NONE

config BT_NIMBLE_TRANSPORT_UART_PARITY_ODD
int
default 0 if !UART_PARITY_ODD
default 1 if UART_PARITY_ODD

config BT_NIMBLE_TRANSPORT_UART_PARITY_EVEN
int
default 0 if !UART_PARITY_EVEN
default 1 if UART_PARITY_EVEN

config BT_NIMBLE_UART_RX_PIN
int "Rx pin for Nimble Uart"
int "UART Rx pin"
depends on BT_CONTROLLER_DISABLED && BT_NIMBLE_TRANSPORT_UART
default 5
help
Rx pin for Nimble Transport

config BT_NIMBLE_UART_TX_PIN
int "Tx pin for Nimble Uart"
int "UART Tx pin"
depends on BT_CONTROLLER_DISABLED && BT_NIMBLE_TRANSPORT_UART
default 4
help
Tx pin for Nimble Transport

choice BT_NIMBLE_USE_HCI_UART_FLOW_CTRL
prompt "Uart Flow Control"
default UART_HW_FLOWCTRL_DISABLE
help
Uart Flow Control

config UART_HW_FLOWCTRL_DISABLE
bool "Disable"
config UART_HW_FLOWCTRL_CTS_RTS
bool "Enable hardware flow control"
endchoice

config BT_NIMBLE_HCI_UART_FLOW_CTRL
int
default 0 if UART_HW_FLOWCTRL_DISABLE
default 1 if UART_HW_FLOWCTRL_CTS_RTS

config BT_NIMBLE_HCI_UART_RTS_PIN
int "UART Rts Pin"
default 19
help
UART HCI RTS pin

config BT_NIMBLE_HCI_UART_CTS_PIN
int "UART Cts Pin"
default 23
help
UART HCI CTS pin
endmenu
2 changes: 1 addition & 1 deletion components/bt/host/nimble/nimble
16 changes: 7 additions & 9 deletions components/bt/host/nimble/port/include/esp_nimble_cfg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -1794,25 +1794,23 @@

#if CONFIG_BT_CONTROLLER_DISABLED
#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_PORT
/* #ifdef CONFIG_BT_NIMBLE_TRANSPORT_UART_PORT */
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PORT /* CONFIG_BT_NIMBLE_TRANSPORT_UART_PORT */ (1)
/* #endif */
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PORT CONFIG_BT_NIMBLE_TRANSPORT_UART_PORT
#endif

#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY_none
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY_none MYNEWT_VAL_BLE_HCI_UART_PARITY
#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__none
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__none CONFIG_BT_NIMBLE_TRANSPORT_UART_PARITY_NONE
#endif

#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__odd
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__odd (0)
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__odd CONFIG_BT_NIMBLE_TRANSPORT_UART_PARITY_ODD
#endif

#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__even
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__even (0)
#define MYNEWT_VAL_BLE_TRANSPORT_UART_PARITY__even CONFIG_BT_NIMBLE_TRANSPORT_UART_PARITY_EVEN
#endif

#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_FLOW_CONTROL__rtscts
#define MYNEWT_VAL_BLE_TRANSPORT_UART_FLOW_CONTROL__rtscts (0)
#define MYNEWT_VAL_BLE_TRANSPORT_UART_FLOW_CONTROL__rtscts CONFIG_BT_NIMBLE_HCI_UART_FLOW_CTRL
#endif

#ifndef MYNEWT_VAL_BLE_TRANSPORT_UART_BAUDRATE
Expand Down

0 comments on commit a707ab9

Please sign in to comment.