Skip to content

Commit af19cea

Browse files
authored
Merge pull request #791 from rmccaskill/master
Fix _irq_handler
2 parents 4acf451 + 1c3ee01 commit af19cea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/RotaryEncoder/SwRotaryEncoder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ void SwRotaryEncoder::clearAbs(void)
120120

121121
void SwRotaryEncoder::_irq_handler(void)
122122
{
123-
uint32_t val = NRF_GPIO->IN;
124-
uint8_t bita = bitRead(val, _pina);
123+
uint8_t bita = digitalRead(_pina);
124+
uint8_t bitb = digitalRead(_pinb);
125125

126126
if ( bita != _a_last)
127127
{
128128
int32_t step;
129129

130-
if ( bita != bitRead(val, _pinb) )
130+
if ( bita != bitb )
131131
{
132132
step = 1;
133133
}else

0 commit comments

Comments
 (0)