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 <[email protected]>
Signed-off-by: Alexandre Bourdiol <[email protected]>
  • Loading branch information
ABOSTM committed Dec 10, 2021
1 parent 6eb25bc commit 0d821e8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/utility/STM32Cube_FW/shci_tl.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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 @@ -250,11 +252,12 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
/* 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 Down

0 comments on commit 0d821e8

Please sign in to comment.