Merge pull request from dhalbert/samd21-tick-event

samd21: port_disable_tick() should disable event channel
This commit is contained in:
Scott Shawcroft 2022-11-16 09:05:48 -08:00 committed by GitHub
commit a4bd7721e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -644,6 +644,10 @@ void port_disable_tick(void) {
RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2;
#endif #endif
#ifdef SAMD21 #ifdef SAMD21
if (_tick_event_channel == EVSYS_SYNCH_NUM) {
return;
}
if (_tick_event_channel >= 8) { if (_tick_event_channel >= 8) {
uint8_t value = 1 << (_tick_event_channel - 8); uint8_t value = 1 << (_tick_event_channel - 8);
EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVDp8(value); EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVDp8(value);
@ -651,6 +655,7 @@ void port_disable_tick(void) {
uint8_t value = 1 << _tick_event_channel; uint8_t value = 1 << _tick_event_channel;
EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVD(value); EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVD(value);
} }
disable_event_channel(_tick_event_channel);
_tick_event_channel = EVSYS_SYNCH_NUM; _tick_event_channel = EVSYS_SYNCH_NUM;
#endif #endif
} }