From 4ece9023a2852f703c7f349242b0231cde3e2a1d Mon Sep 17 00:00:00 2001 From: Donatien Garnier Date: Wed, 5 Dec 2018 16:16:58 +0000 Subject: [PATCH] Cordio: Split get_buffer_pool_description() in pure virtual + default implementation to avoid allocating two memory pools in a static fashion --- .../targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp | 2 +- .../targets/TARGET_CORDIO/driver/CordioHCIDriver.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp index 9ca29a336e..6c41735a0d 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp @@ -78,7 +78,7 @@ void CordioHCIDriver::terminate() _transport_driver.terminate(); } -buf_pool_desc_t CordioHCIDriver::get_buffer_pool_description() +buf_pool_desc_t CordioHCIDriver::get_default_buffer_pool_description() { static union { uint8_t buffer[2250]; diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h index a3b923e270..9f4ee31c7a 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h @@ -77,7 +77,7 @@ public: /** * Return the set of memory pool which will be used by the Cordio stack */ - virtual buf_pool_desc_t get_buffer_pool_description(); + virtual buf_pool_desc_t get_buffer_pool_description() = 0; /** * Initialize the HCI driver. @@ -126,6 +126,12 @@ public: */ uint16_t write(uint8_t type, uint16_t len, uint8_t *pData); +protected: + /** + * Return a defai;t set of memory pool which will be used by the Cordio stack + */ + buf_pool_desc_t get_default_buffer_pool_description(); + private: /** * Initialize the chip.