Skip to content

Commit 5ceaf45

Browse files
authored
Merge pull request stm32duino#23 from FRASTM/wb55_ble
Timeout returned when configuring BLE stack for SharedMem transport
2 parents 4867274 + 3a063df commit 5ceaf45

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/utility/STM32Cube_FW/shci_tl.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
/* Includes ------------------------------------------------------------------*/
2222
#include "stm32_wpan_common.h"
2323

24+
#include <Arduino.h>
25+
2426
#include "stm_list.h"
2527
#include "shci_tl.h"
2628
#include "stm32_def.h"
@@ -323,11 +325,12 @@ static void OutputEvtTrace(TL_EvtPacket_t *phcievtbuffer)
323325
/* Weak implementation ----------------------------------------------------------------*/
324326
__WEAK void shci_cmd_resp_wait(uint32_t timeout)
325327
{
326-
(void)timeout;
327-
328328
CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT;
329-
while (CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE);
330-
329+
for (unsigned long start = millis(); (millis() - start) < timeout;) {
330+
if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) {
331+
break;
332+
}
333+
}
331334
return;
332335
}
333336

0 commit comments

Comments
 (0)