Skip to content

Commit

Permalink
Merge pull request #88 from MLXXXp/buttonsState_calls
Browse files Browse the repository at this point in the history
Change getInput() calls to buttonsState()
  • Loading branch information
joshgoebel committed Feb 15, 2016
2 parents 86e212e + 123d82c commit c02cb9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Arduboy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,14 +699,12 @@ unsigned char* Arduboy::getBuffer()

boolean Arduboy::pressed(uint8_t buttons)
{
uint8_t button_state = getInput();
return (button_state & buttons) == buttons;
return (buttonsState() & buttons) == buttons;
}

boolean Arduboy::notPressed(uint8_t buttons)
{
uint8_t button_state = getInput();
return (button_state & buttons) == 0;
return (buttonsState() & buttons) == 0;
}

void Arduboy::swap(int16_t& a, int16_t& b)
Expand Down
2 changes: 1 addition & 1 deletion core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void ArduboyCore::boot()
bootLCD();

#ifdef SAFE_MODE
if (getInput() == (LEFT_BUTTON | UP_BUTTON))
if (buttonsState() == (LEFT_BUTTON | UP_BUTTON))
safeMode();
#endif

Expand Down

0 comments on commit c02cb9b

Please sign in to comment.