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 23
23
// In this case, bits which are equal to 0 are the bits reserved in this register
24
24
#define SCB_ICSR_RESERVED_BITS_MASK 0x9E43F03F
25
25
26
+ #define FPU_EXCEPTION_MASK 0x0000009F
27
+
26
28
void sleep (void )
27
29
{
28
30
// ensure debug is disconnected if semihost is enabled....
@@ -31,6 +33,13 @@ void sleep(void)
31
33
// the processor from disabled interrupts.
32
34
SCB -> SCR |= SCB_SCR_SEVONPEND_Msk ;
33
35
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
+
34
43
// If the SoftDevice is enabled, its API must be used to go to sleep.
35
44
if (softdevice_handler_isEnabled ()) {
36
45
sd_power_mode_set (NRF_POWER_MODE_LOWPWR );
You can’t perform that action at this time.
0 commit comments