diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c index 1ab15b47..c2d7589e 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -21,6 +21,8 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" +#include + #include "stm_list.h" #include "shci_tl.h" #include "stm32_def.h" @@ -323,11 +325,12 @@ static void OutputEvtTrace(TL_EvtPacket_t *phcievtbuffer) /* Weak implementation ----------------------------------------------------------------*/ __WEAK void shci_cmd_resp_wait(uint32_t timeout) { - (void)timeout; - CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT; - while (CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE); - + for (unsigned long start = millis(); (millis() - start) < timeout;) { + if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) { + break; + } + } return; }