diff --git a/cores/nRF5/Arduino.h b/cores/nRF5/Arduino.h index a968ec19..7f8fc54d 100644 --- a/cores/nRF5/Arduino.h +++ b/cores/nRF5/Arduino.h @@ -111,9 +111,7 @@ uint32_t setLoopStacksize(void); #define digitalPinHasPWM(P) ( true ) // Hint instruction to tell CPU go to low power mode -#define waitForEvent() __WFE() - -extern void rtos_idle_callback(void) ATTR_WEAK; +#define waitForEvent() sd_app_evt_wait() // __WFE() /* * digitalPinToTimer(..) is AVR-specific and is not defined for nRF52 diff --git a/cores/nRF5/WVariant.h b/cores/nRF5/WVariant.h index 7b43db55..c56d249d 100644 --- a/cores/nRF5/WVariant.h +++ b/cores/nRF5/WVariant.h @@ -20,6 +20,8 @@ #include #include +#include "nrf.h" +#include "nrf_soc.h" #ifdef __cplusplus extern "C" { diff --git a/cores/nRF5/rtos.cpp b/cores/nRF5/rtos.cpp index e4f1cfbf..8129e2af 100644 --- a/cores/nRF5/rtos.cpp +++ b/cores/nRF5/rtos.cpp @@ -82,6 +82,9 @@ bool SchedulerRTOS::startLoop(taskfunc_t task, const char* name, uint32_t stack_ return pdPASS == xTaskCreate( _redirect_task, name, stack_size, (void*) task, TASK_PRIO_NORMAL, &handle); } +void rtos_idle_callback(void) ATTR_WEAK; +void rtos_idle_callback(void) {} + extern "C" {