mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Also update the ButtonClickState variable when the Xbox button is pressed
Fixes #299
This commit is contained in:
parent
e7d0695616
commit
39150a15ea
1 changed files with 5 additions and 0 deletions
|
@ -266,6 +266,11 @@ void XBOXONE::readReport() {
|
||||||
ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]);
|
ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]);
|
||||||
else
|
else
|
||||||
ButtonState &= ~pgm_read_word(&XBOX_BUTTONS[XBOX]);
|
ButtonState &= ~pgm_read_word(&XBOX_BUTTONS[XBOX]);
|
||||||
|
|
||||||
|
if(ButtonState != OldButtonState) {
|
||||||
|
ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
|
||||||
|
OldButtonState = ButtonState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports
|
if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports
|
||||||
#ifdef EXTRADEBUG
|
#ifdef EXTRADEBUG
|
||||||
|
|
Loading…
Reference in a new issue