SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
564 stars 148 forks source link

detachInterrupt broke PINxCTRL Pullup #1143

Closed PM04290 closed 1 month ago

PM04290 commented 2 months ago

using detachInterrupt broke previous pinMode(pin, INPUT_PULLUP) by putting 0x07 mask on PINxCTRL register.

SpenceKonde commented 1 month ago

Thanks. Actually, what it was doing was bitwise anding it with 0xF1, instead of 0xF8 (=~0x07). Thus it is failing to clear the interrupt sense configuration's low bit in addition to trashing the pullup setting. So half of the options won't actually properly turn off either)

SpenceKonde commented 1 month ago

c03d4a592aab37f071abebde3849a1126dfc856c fixes this issue