From dd26a3e8a70d1b6f278c83f1e6bbb1cf2333e644 Mon Sep 17 00:00:00 2001 From: Kevin Gillespie Date: Wed, 24 Jul 2024 11:09:43 -0500 Subject: [PATCH] refactor(BLE): Updating API to match new Library (#1085) --- Examples/MAX32655/Bluetooth/BLE4_ctr/main.c | 4 +++- Examples/MAX32655/Bluetooth/BLE5_ctr/main.c | 4 +++- Examples/MAX32665/Bluetooth/BLE4_ctr/main.c | 4 +++- Examples/MAX32665/Bluetooth/BLE5_ctr/main.c | 4 +++- Examples/MAX32690/Bluetooth/BLE4_ctr/main.c | 4 +++- Examples/MAX32690/Bluetooth/BLE5_ctr/main.c | 4 +++- Libraries/Cordio/controller/include/common/chci_tr.h | 2 +- Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c | 2 -- Libraries/Cordio/controller/sources/ble/ll/ll_main_dtm.c | 2 +- Libraries/Cordio/controller/sources/common/chci/chci_tr.c | 2 +- Libraries/Cordio/wsf/include/wsf_os.h | 2 +- Libraries/Cordio/wsf/include/wsf_types.h | 3 +++ 12 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Examples/MAX32655/Bluetooth/BLE4_ctr/main.c b/Examples/MAX32655/Bluetooth/BLE4_ctr/main.c index cdcd9b61eeb..d477d982d98 100644 --- a/Examples/MAX32655/Bluetooth/BLE4_ctr/main.c +++ b/Examples/MAX32655/Bluetooth/BLE4_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" #include "pal_cfg.h" @@ -130,7 +132,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Examples/MAX32655/Bluetooth/BLE5_ctr/main.c b/Examples/MAX32655/Bluetooth/BLE5_ctr/main.c index a8b1f7bb664..b3f59a29f05 100644 --- a/Examples/MAX32655/Bluetooth/BLE5_ctr/main.c +++ b/Examples/MAX32655/Bluetooth/BLE5_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "wsf_cs.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" @@ -162,7 +164,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Examples/MAX32665/Bluetooth/BLE4_ctr/main.c b/Examples/MAX32665/Bluetooth/BLE4_ctr/main.c index cdcd9b61eeb..d477d982d98 100644 --- a/Examples/MAX32665/Bluetooth/BLE4_ctr/main.c +++ b/Examples/MAX32665/Bluetooth/BLE4_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" #include "pal_cfg.h" @@ -130,7 +132,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Examples/MAX32665/Bluetooth/BLE5_ctr/main.c b/Examples/MAX32665/Bluetooth/BLE5_ctr/main.c index 4df76f046c3..62ff05a1c54 100644 --- a/Examples/MAX32665/Bluetooth/BLE5_ctr/main.c +++ b/Examples/MAX32665/Bluetooth/BLE5_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "wsf_cs.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" @@ -162,7 +164,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Examples/MAX32690/Bluetooth/BLE4_ctr/main.c b/Examples/MAX32690/Bluetooth/BLE4_ctr/main.c index cdcd9b61eeb..d477d982d98 100644 --- a/Examples/MAX32690/Bluetooth/BLE4_ctr/main.c +++ b/Examples/MAX32690/Bluetooth/BLE4_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" #include "pal_cfg.h" @@ -130,7 +132,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Examples/MAX32690/Bluetooth/BLE5_ctr/main.c b/Examples/MAX32690/Bluetooth/BLE5_ctr/main.c index 7bb51c18a2b..f4b076f5f24 100644 --- a/Examples/MAX32690/Bluetooth/BLE5_ctr/main.c +++ b/Examples/MAX32690/Bluetooth/BLE5_ctr/main.c @@ -33,6 +33,8 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "wsf_bufio.h" +#include "wsf_types.h" +#include "wsf_os.h" #include "wsf_cs.h" #include "bb_ble_sniffer_api.h" #include "pal_bb.h" @@ -162,7 +164,7 @@ static void mainWsfInit(void) * \return TRUE if there is token pending. */ /*************************************************************************************************/ -static bool_t mainCheckServiceTokens(void) +static bool mainCheckServiceTokens(void) { bool_t eventPending = FALSE; diff --git a/Libraries/Cordio/controller/include/common/chci_tr.h b/Libraries/Cordio/controller/include/common/chci_tr.h index 591e6452d73..37bb32cb6ea 100644 --- a/Libraries/Cordio/controller/include/common/chci_tr.h +++ b/Libraries/Cordio/controller/include/common/chci_tr.h @@ -75,7 +75,7 @@ void chciTrSendComplete(void); * \return TRUE if work pending, FALSE if no work is pending. */ /*************************************************************************************************/ -bool_t ChciTrService(void); +bool ChciTrService(void); #ifdef __cplusplus }; diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c index 666385ca2c2..e9993cd71d5 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c @@ -82,7 +82,6 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) uint8_t status = HCI_SUCCESS; uint8_t evtParamLen = 1; /* default is status field only */ uint32_t regReadAddr = 0; - uint8_t channel = 0; /* Decode and consume command packet. */ @@ -214,7 +213,6 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) case LHCI_OPCODE_VS_GET_RSSI: { status = LL_SUCCESS; - channel = pBuf[0]; evtParamLen += sizeof(int8_t); break; } diff --git a/Libraries/Cordio/controller/sources/ble/ll/ll_main_dtm.c b/Libraries/Cordio/controller/sources/ble/ll/ll_main_dtm.c index 2aa1cbbe48a..af9aa63ac81 100644 --- a/Libraries/Cordio/controller/sources/ble/ll/ll_main_dtm.c +++ b/Libraries/Cordio/controller/sources/ble/ll/ll_main_dtm.c @@ -913,7 +913,7 @@ uint8_t LlEnhancedRxTest(uint8_t rfChan, uint8_t phy, uint8_t modIdx, uint16_t n llTestCb.state = LL_TEST_STATE_RX; lmgrCb.testEnabled = TRUE; LmgrIncResetRefCount(); - memset(&llTestCb.rpt, 0, sizeof(llTestCb.rpt)); /* clear report */ + memset((void*)&llTestCb.rpt, 0, sizeof(llTestCb.rpt)); /* clear report */ BbStart(BB_PROT_BLE_DTM); SchInsertNextAvailable(pOp); diff --git a/Libraries/Cordio/controller/sources/common/chci/chci_tr.c b/Libraries/Cordio/controller/sources/common/chci/chci_tr.c index 391e9d69ac0..1a38fd60e6c 100644 --- a/Libraries/Cordio/controller/sources/common/chci/chci_tr.c +++ b/Libraries/Cordio/controller/sources/common/chci/chci_tr.c @@ -635,7 +635,7 @@ void chciTrRecv(uint8_t prot, uint8_t type, uint8_t *pBuf) * \return TRUE if work pending, FALSE if no work is pending. */ /*************************************************************************************************/ -bool_t ChciTrService(void) +bool ChciTrService(void) { #if (CHCI_TR_UART == 1) if (chciTrCb.wrBufComp) diff --git a/Libraries/Cordio/wsf/include/wsf_os.h b/Libraries/Cordio/wsf/include/wsf_os.h index 76a81a7b2af..98b24612eb2 100644 --- a/Libraries/Cordio/wsf/include/wsf_os.h +++ b/Libraries/Cordio/wsf/include/wsf_os.h @@ -97,7 +97,7 @@ typedef wsfHandlerId_t wsfTaskId_t; typedef uint8_t wsfTaskEvent_t; /*! \brief Idle check function. */ -typedef bool_t (*WsfOsIdleCheckFunc_t)(void); +typedef bool (*WsfOsIdleCheckFunc_t)(void); /************************************************************************************************** External Variables diff --git a/Libraries/Cordio/wsf/include/wsf_types.h b/Libraries/Cordio/wsf/include/wsf_types.h index e7815d5b9d5..73a5ead76c8 100644 --- a/Libraries/Cordio/wsf/include/wsf_types.h +++ b/Libraries/Cordio/wsf/include/wsf_types.h @@ -47,6 +47,9 @@ extern "C" { #define bool_t uint8_t #endif +/* New library uses bool instead of bool_t */ +#define bool _Bool + #ifndef FALSE #define FALSE 0 #endif