Skip to content

Commit

Permalink
Merge pull request #791 from rmccaskill/master
Browse files Browse the repository at this point in the history
Fix _irq_handler
  • Loading branch information
hathach committed Oct 16, 2023
2 parents 4acf451 + 1c3ee01 commit af19cea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/RotaryEncoder/SwRotaryEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ void SwRotaryEncoder::clearAbs(void)

void SwRotaryEncoder::_irq_handler(void)
{
uint32_t val = NRF_GPIO->IN;
uint8_t bita = bitRead(val, _pina);
uint8_t bita = digitalRead(_pina);
uint8_t bitb = digitalRead(_pinb);

if ( bita != _a_last)
{
int32_t step;

if ( bita != bitRead(val, _pinb) )
if ( bita != bitb )
{
step = 1;
}else
Expand Down

0 comments on commit af19cea

Please sign in to comment.