Skip to content

Commit 2facbf6

Browse files
ggajochsandeepmistry
authored andcommitted
Fix interrupt mask to block in SPI library
1 parent bdf0608 commit 2facbf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/SPI/SPI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void SPIClass::usingInterrupt(int interruptNumber)
105105
else
106106
{
107107
interruptMode |= SPI_IMODE_EXTINT;
108-
interruptMask |= (1 << interruptNumber);
108+
interruptMask |= (1 << g_APinDescription[interruptNumber].ulExtInt);
109109
}
110110

111111
if (irestore)
@@ -123,7 +123,7 @@ void SPIClass::notUsingInterrupt(int interruptNumber)
123123
uint8_t irestore = interruptsStatus();
124124
noInterrupts();
125125

126-
interruptMask &= ~(1 << interruptNumber);
126+
interruptMask &= ~(1 << g_APinDescription[interruptNumber].ulExtInt);
127127

128128
if (interruptMask == 0)
129129
interruptMode = SPI_IMODE_NONE;

0 commit comments

Comments
 (0)