Fix for https://github.com/PaulStoffregen/cores/issues/499main
gpio[EDGE_INDEX] |= mask; | gpio[EDGE_INDEX] |= mask; | ||||
} else { | } else { | ||||
gpio[EDGE_INDEX] &= ~mask; | gpio[EDGE_INDEX] &= ~mask; | ||||
if (index < 15) { | |||||
if (index < 16) { | |||||
uint32_t shift = index * 2; | uint32_t shift = index * 2; | ||||
gpio[ICR1_INDEX] = (gpio[ICR1_INDEX] & ~(3 << shift)) | (icr << shift); | gpio[ICR1_INDEX] = (gpio[ICR1_INDEX] & ~(3 << shift)) | (icr << shift); | ||||
} else { | } else { |