From ccc1ee4021d3234cb4b5359ee0161e4e60d374c8 Mon Sep 17 00:00:00 2001 From: Ciaran Woodward Date: Mon, 20 Dec 2021 14:47:20 +0000 Subject: [PATCH] Fix inverted isSilenced logic, add INVALID_ID constant --- lib_xua/src/core/user/hid/user_hid.h | 3 ++- lib_xua/src/hid/hid.xc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_xua/src/core/user/hid/user_hid.h b/lib_xua/src/core/user/hid/user_hid.h index 0ed07904..b17a4dd5 100644 --- a/lib_xua/src/core/user/hid/user_hid.h +++ b/lib_xua/src/core/user/hid/user_hid.h @@ -31,7 +31,8 @@ typedef struct hidEvent_t { unsigned value; } hidEvent_t; -#define HID_MAX_DATA_BYTES 4 +#define HID_MAX_DATA_BYTES ( 4 ) +#define HID_EVENT_INVALID_ID ( 0x100 ) #if( 0 < HID_CONTROLS ) diff --git a/lib_xua/src/hid/hid.xc b/lib_xua/src/hid/hid.xc index fd8f6fab..d9a0d500 100644 --- a/lib_xua/src/hid/hid.xc +++ b/lib_xua/src/hid/hid.xc @@ -39,7 +39,7 @@ unsigned HidIsSetIdleSilenced( const unsigned id ) { unsigned isSilenced = hidIsIdleActive( id ); - if( isSilenced ) { + if( !isSilenced ) { unsigned currentTime; // Use inline assembly to access the time without creating a side-effect. // The mapper complains if the time comes from an XC timer because this function is called in the guard of a select case.