Skip to content

Commit

Permalink
fix: include a timeout when waiting for the cmd_resp
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Ramu <francois.ramu@st.com>
  • Loading branch information
fpistm committed Dec 2, 2021
1 parent 108f46f commit 09680e7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/utility/STM32Cube_FW/shci_tl.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/* Includes ------------------------------------------------------------------*/
#include "stm32_wpan_common.h"

#include <Arduino.h>

#include "stm_list.h"
#include "shci_tl.h"
#include "stm32_def.h"
Expand Down Expand Up @@ -346,11 +348,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;
}

Expand All @@ -363,4 +366,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
return;
}

#endif /* STM32WBxx */
#endif /* STM32WBxx */

0 comments on commit 09680e7

Please sign in to comment.