From b9f3f1a478f05478756b06ee1b1bcce085ddadec Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 1 Apr 2017 22:38:46 +0200 Subject: [PATCH] esp32: enable Controller to Host Flow Control --- .../template/components/btstack/include/btstack_config.h | 6 ++++++ port/esp32/template/components/btstack/main.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/port/esp32/template/components/btstack/include/btstack_config.h b/port/esp32/template/components/btstack/include/btstack_config.h index 238fd8af2..83dd057e6 100644 --- a/port/esp32/template/components/btstack/include/btstack_config.h +++ b/port/esp32/template/components/btstack/include/btstack_config.h @@ -39,5 +39,11 @@ #define MAX_NR_LE_DEVICE_DB_ENTRIES 0 // +// HCI Controller to Host Flow Control +#define ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL +#define HCI_HOST_ACL_PACKET_NUM 10 +#define HCI_HOST_ACL_PACKET_LEN 1024 +#define HCI_HOST_SCO_PACKET_NUM 10 +#define HCI_HOST_SCO_PACKET_LEN 60 #endif diff --git a/port/esp32/template/components/btstack/main.c b/port/esp32/template/components/btstack/main.c index d415a77c6..cdae11502 100644 --- a/port/esp32/template/components/btstack/main.c +++ b/port/esp32/template/components/btstack/main.c @@ -71,9 +71,9 @@ uint32_t hal_time_ms(void) { static void (*transport_packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); // ring buffer for incoming HCI packets -#define MAX_NR_HOST_ACL_PACKETS 10 #define MAX_NR_HOST_EVENT_PACKETS 4 -static uint8_t hci_ringbuffer_storage[MAX_NR_HOST_ACL_PACKETS * (1 + HCI_ACL_HEADER_SIZE + HCI_ACL_3DH5_SIZE) + +static uint8_t hci_ringbuffer_storage[HCI_HOST_ACL_PACKET_NUM * (1 + HCI_ACL_HEADER_SIZE + HCI_HOST_ACL_PACKET_LEN) + + HCI_HOST_SCO_PACKET_NUM * (1 + HCI_SCO_HEADER_SIZE + HCI_HOST_SCO_PACKET_LEN) + (MAX_NR_HOST_EVENT_PACKETS * HCI_EVENT_BUFFER_SIZE)]; static btstack_ring_buffer_t hci_ringbuffer;