Skip to content

Commit a4bd772

Browse files
authored
Merge pull request #7217 from dhalbert/samd21-tick-event
samd21: port_disable_tick() should disable event channel
2 parents ef34378 + b74893e commit a4bd772

File tree

1 file changed

+5
-0
lines changed
  • ports/atmel-samd/supervisor

1 file changed

+5
-0
lines changed

ports/atmel-samd/supervisor/port.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,18 @@ void port_disable_tick(void) {
644644
RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2;
645645
#endif
646646
#ifdef SAMD21
647+
if (_tick_event_channel == EVSYS_SYNCH_NUM) {
648+
return;
649+
}
650+
647651
if (_tick_event_channel >= 8) {
648652
uint8_t value = 1 << (_tick_event_channel - 8);
649653
EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVDp8(value);
650654
} else {
651655
uint8_t value = 1 << _tick_event_channel;
652656
EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVD(value);
653657
}
658+
disable_event_channel(_tick_event_channel);
654659
_tick_event_channel = EVSYS_SYNCH_NUM;
655660
#endif
656661
}

0 commit comments

Comments
 (0)