From 5f6bedf762b1c130069a4c4df892400c18b1bff0 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:14:11 -0600 Subject: [PATCH] update tickless to use PalBbIsEnabled --- .../MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c | 5 ++--- .../Bluetooth/BLE_fit_FreeRTOS/freertos_tickless.c | 5 ++--- .../MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c | 8 ++++---- .../MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c | 5 ++--- Libraries/Cordio/platform/include/pal_bb.h | 8 ++++++++ 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Examples/MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c b/Examples/MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c index c26c31922e8..a86ce30aa21 100644 --- a/Examples/MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c +++ b/Examples/MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c @@ -75,9 +75,8 @@ int freertos_permit_tickless(void) return E_BUSY; } - uint32_t dummy; - bool_t ret = PalBbGetTimestamp(&dummy); - if (!ret) { + if(PalBbIsEnabled()) + { return E_BUSY; } diff --git a/Examples/MAX32655/Bluetooth/BLE_fit_FreeRTOS/freertos_tickless.c b/Examples/MAX32655/Bluetooth/BLE_fit_FreeRTOS/freertos_tickless.c index bf78e9ea08b..561d5f7f1af 100644 --- a/Examples/MAX32655/Bluetooth/BLE_fit_FreeRTOS/freertos_tickless.c +++ b/Examples/MAX32655/Bluetooth/BLE_fit_FreeRTOS/freertos_tickless.c @@ -75,9 +75,8 @@ int freertos_permit_tickless(void) return E_BUSY; } - uint32_t dummy; - bool_t ret = PalBbGetTimestamp(&dummy); - if (!ret) { + if(PalBbIsEnabled()) + { return E_BUSY; } diff --git a/Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c b/Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c index 9e6813a05b1..b54e1bbacca 100644 --- a/Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c +++ b/Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c @@ -76,13 +76,13 @@ int freertos_permit_tickless(void) if (MXC_UART_GetActive(MXC_UART_GET_UART(CONSOLE_UART)) != E_NO_ERROR) { return E_BUSY; } - - uint32_t dummy; - bool_t ret = PalBbGetTimestamp(&dummy); - if (!ret) { + + if(PalBbIsEnabled()) + { return E_BUSY; } + return E_NO_ERROR; } diff --git a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c index 45c416a1ed5..f8837cad049 100644 --- a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c +++ b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c @@ -75,9 +75,8 @@ int freertos_permit_tickless(void) return E_BUSY; } - uint32_t dummy; - bool_t ret = PalBbGetTimestamp(&dummy); - if (!ret) { + if(PalBbIsEnabled()) + { return E_BUSY; } diff --git a/Libraries/Cordio/platform/include/pal_bb.h b/Libraries/Cordio/platform/include/pal_bb.h index aba61dbedaf..2020ba5a0e8 100644 --- a/Libraries/Cordio/platform/include/pal_bb.h +++ b/Libraries/Cordio/platform/include/pal_bb.h @@ -219,6 +219,8 @@ void PalBbEnable(void); /*************************************************************************************************/ bool PalBbIsEnabled(void); + + /*************************************************************************************************/ /*! * \brief Disable the BB hardware. @@ -342,6 +344,12 @@ bool PalBbFgenIsEnabled(void); /*************************************************************************************************/ bool_t PalBbGetRssi(int8_t *rssi, uint8_t rfChannel); +bool __attribute__((weak)) PalBbIsEnabled(void) +{ + uint32_t dummy; + return PalBbGetTimestamp(&dummy); +} + static inline bool PalBbIsValidPrbsType(uint8_t maybeType) { switch (maybeType)