mirror of
https://github.com/lemmingDev/ESP32-BLE-Gamepad.git
synced 2026-03-20 15:06:57 +01:00
Use memcmp to compare arrays
This commit is contained in:
@@ -124,7 +124,7 @@ void loop()
|
||||
bleGamepad.setHats(hatValues[0], hatValues[1], hatValues[2], hatValues[3]);
|
||||
|
||||
// Update previous states to current states and send report
|
||||
if (currentButtonStates != previousButtonStates || currentHatStates != previousHatStates)
|
||||
if ((memcmp((const void *)currentButtonStates, (const void *)previousButtonStates, sizeof(currentButtonStates)) != 0) && (memcmp((const void *)currentHatStates, (const void *)previousHatStates, sizeof(currentHatStates)) != 0))
|
||||
{
|
||||
for (byte currentIndex = 0; currentIndex < numOfButtons; currentIndex++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user