Skip to content

Commit f37ce1c

Browse files
committed
atmel-samd: Turn off PulseIn interrupts on reset. Can hardfault otherwise.
1 parent f0e24bd commit f37ce1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ static uint16_t last_us[EIC_NUMBER_OF_INTERRUPTS];
4848

4949
void pulsein_reset(void) {
5050
for (int i = 0; i < EIC_NUMBER_OF_INTERRUPTS; i++) {
51+
if (active_pulseins[i] != NULL) {
52+
extint_chan_disable_callback(i, EXTINT_CALLBACK_TYPE_DETECT);
53+
}
5154
active_pulseins[i] = NULL;
5255
last_ms[i] = 0;
5356
last_us[i] = 0;

0 commit comments

Comments
 (0)