Skip to content

Commit f294447

Browse files
committed
Moved nextTimeout variable out of critical section in BLE::callDispatcher.
Initialization of Timeout object contains critical section inside constructor. Initialization inside critical section caused assertion failing under "debug" profile.
1 parent 51b8d6e commit f294447

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ void BLE::callDispatcher()
423423

424424
wsfOsDispatcher();
425425

426+
static Timeout nextTimeout;
426427
CriticalSectionLock critical_section;
427428

428429
if (wsfOsReadyToSleep()) {
429-
static Timeout nextTimeout;
430430
// setup an mbed timer for the next Cordio timeout
431431
bool_t pTimerRunning;
432432
timestamp_t nextTimestamp = (timestamp_t) (WsfTimerNextExpiration(&pTimerRunning) * WSF_MS_PER_TICK) * 1000;

0 commit comments

Comments
 (0)