fix(pan-cordio): Wrap call to wsfOsReadyToSleep in a critical section

The function wsfOsReadyToSleep should only be called when interrupts are
disabled. Entering a critical section before calling the function fixes
any potential issues.
pull/8876/head
Steve Cartmell 2018-11-21 17:56:14 +00:00 committed by Vincent Coubard
parent f60c2c9aa8
commit 5782e93a19
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "mbed.h"
#include "us_ticker_api.h"
#include "BLE.h"
#include "CriticalSectionLock.h"
#include "wsf_types.h"
#include "wsf_msg.h"
#include "wsf_os.h"
@ -412,6 +413,8 @@ void BLE::callDispatcher()
wsfOsDispatcher();
CriticalSectionLock critical_section;
if (wsfOsReadyToSleep()) {
static Timeout nextTimeout;
// setup an mbed timer for the next Cordio timeout