wireless/bluetooth/bt_hcicore.c: Bluetooth firmware download logic of commit 05bbbec3e1 breaks all bluetooth builds. This commit fixes that by making that firmware download configurable. It is disabled by default so that all of the pre-existing configurations will continue to build.

This commit is contained in:
Gregory Nutt 2019-09-21 08:07:21 -06:00
parent 261cd9df4b
commit e2d80b6990
3 changed files with 22 additions and 8 deletions

View File

@ -54,6 +54,20 @@ menuconfig WIRELESS_BLUETOOTH
if WIRELESS_BLUETOOTH
config BLUETOOTH_FIRMWARE_DOWNLOAD
bool "Generic firmware download"
default n
---help---
Enables support for generic firmware download in the MAC layer. Do
not enable this option if no download is required OR if the download
if performed by the Bluetooth HCI layer.
If this option is selected, then your board-specific code must
provide the firmware data via:
const uint8_t bt_firmware_hcd[];
const long int bt_firmware_len;
config BLUETOOTH_MAX_CONN
int "Maximum number of simultaneous connections"
default 1

View File

@ -83,8 +83,6 @@
#define TIMEOUT_SEC 2
#define TIMEOUT_NSEC 500 * 1024 * 1024
#define BT_FIRMWARE_UPLOAD /* REVISIT: Should be a Kconfig option? */
/****************************************************************************
* Public Data
****************************************************************************/
@ -97,11 +95,6 @@
struct bt_dev_s g_btdev;
#ifdef BT_FIRMWARE_UPLOAD
extern const uint8_t bt_firmware_hcd[];
const long int bt_firmware_len;
#endiuf
/****************************************************************************
* Private Data
****************************************************************************/
@ -1207,7 +1200,7 @@ static void le_read_buffer_size_complete(FAR struct bt_buf_s *buf)
*
****************************************************************************/
#ifdef BT_FIRMWARE_UPLOAD
#ifdef CONFIG_BLUETOOTH_FIRMWARE_DOWNLOAD
static int bt_check_fw_upload(void)
{
uint8_t *rp = (uint8_t *)bt_firmware_hcd;

View File

@ -166,6 +166,13 @@ typedef CODE void bt_le_scan_cb_t(FAR const bt_addr_le_t *addr, int8_t rssi,
extern struct bt_dev_s g_btdev;
#ifdef CONFIG_BLUETOOTH_FIRMWARE_DOWNLOAD
/* Location and size of HCI firmware download */
extern const uint8_t bt_firmware_hcd[];
extern const long int bt_firmware_len;
#endif
/****************************************************************************
* Inline Functions
****************************************************************************/