File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
targets/TARGET_NORDIC/TARGET_NRF5 Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2323// In this case, bits which are equal to 0 are the bits reserved in this register
2424#define SCB_ICSR_RESERVED_BITS_MASK 0x9E43F03F
2525
26+ #define FPU_EXCEPTION_MASK 0x0000009F
27+
2628void sleep (void )
2729{
2830 // ensure debug is disconnected if semihost is enabled....
@@ -31,6 +33,13 @@ void sleep(void)
3133 // the processor from disabled interrupts.
3234 SCB -> SCR |= SCB_SCR_SEVONPEND_Msk ;
3335
36+ #ifdef NRF52
37+ /* Clear exceptions and PendingIRQ from the FPU unit */
38+ __set_FPSCR (__get_FPSCR () & ~(FPU_EXCEPTION_MASK ));
39+ (void ) __get_FPSCR ();
40+ NVIC_ClearPendingIRQ (FPU_IRQn );
41+ #endif
42+
3443 // If the SoftDevice is enabled, its API must be used to go to sleep.
3544 if (softdevice_handler_isEnabled ()) {
3645 sd_power_mode_set (NRF_POWER_MODE_LOWPWR );
You can’t perform that action at this time.
0 commit comments