Skip to content

Commit b56455f

Browse files
committed
Allow sleep while paused
1 parent f0859ac commit b56455f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ports/atmel-samd/common-hal/pulseio/PulseIn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) {
272272
void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) {
273273
uint32_t mask = 1 << self->channel;
274274
EIC->INTENCLR.reg = mask << EIC_INTENSET_EXTINT_Pos;
275+
#ifdef SAMD21
276+
rtc_end_pulse();
277+
#endif
275278
}
276279

277280
void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self,
@@ -299,6 +302,9 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self,
299302
EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos;
300303
EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos;
301304

305+
#ifdef SAMD21
306+
rtc_start_pulse();
307+
#endif
302308
pulsein_set_config(self, true);
303309
}
304310

0 commit comments

Comments
 (0)