@@ -153,7 +153,9 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
153
153
PM -> STDBYCFG .reg = PM_STDBYCFG_RAMCFG_OFF ;
154
154
// Set-up Sleep Mode
155
155
PM -> SLEEPCFG .reg = PM_SLEEPCFG_SLEEPMODE_STANDBY ;
156
- while (PM -> SLEEPCFG .bit .SLEEPMODE != PM_SLEEPCFG_SLEEPMODE_STANDBY_Val );
156
+ while (PM -> SLEEPCFG .bit .SLEEPMODE != PM_SLEEPCFG_SLEEPMODE_STANDBY_Val ) {
157
+ ;
158
+ }
157
159
158
160
__DSB (); // Data Synchronization Barrier
159
161
__WFI (); // Wait For Interrupt
@@ -246,7 +248,7 @@ void NORETURN common_hal_alarm_enter_deep_sleep(void) {
246
248
NVIC_EnableIRQ (RTC_IRQn );
247
249
// Set interrupts for COMPARE1 or overflow
248
250
RTC -> MODE0 .INTENSET .reg = RTC_MODE0_INTENSET_CMP1 | RTC_MODE1_INTENSET_OVF ;
249
- }
251
+ }
250
252
// Set-up Deep Sleep Mode
251
253
// RAM retention
252
254
PM -> BKUPCFG .reg = PM_BKUPCFG_BRAMCFG (0x2 ); // No RAM retention 0x2 partial:0x1
@@ -259,7 +261,9 @@ void NORETURN common_hal_alarm_enter_deep_sleep(void) {
259
261
}
260
262
261
263
RTC -> MODE0 .CTRLA .bit .ENABLE = 1 ; // Enable the RTC
262
- while (RTC -> MODE0 .SYNCBUSY .bit .ENABLE ); // Wait for synchronization
264
+ while (RTC -> MODE0 .SYNCBUSY .bit .ENABLE ) { // Wait for synchronization
265
+ ;
266
+ }
263
267
264
268
__DSB (); // Data Synchronization Barrier
265
269
__WFI (); // Wait For Interrupt
@@ -278,7 +282,7 @@ MP_NOINLINE void common_hal_alarm_pretending_deep_sleep(void) {
278
282
279
283
if (!fake_sleep ) {
280
284
SAMD_ALARM_FLAG = 1 ;
281
- while (RTC -> MODE0 .SYNCBUSY .reg ) {
285
+ while (RTC -> MODE0 .SYNCBUSY .reg ) {
282
286
;
283
287
}
284
288
fake_sleep = true;
0 commit comments