Skip to content

Commit a93b516

Browse files
authored
Merge pull request #281 from LeeNX/leenx-add-comment-memcmp
Add comment back of readable if statement
2 parents 33a3dee + 21c9d29 commit a93b516

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/Fightstick/Fightstick.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ void loop()
124124
bleGamepad.setHats(hatValues[0], hatValues[1], hatValues[2], hatValues[3]);
125125

126126
// Update previous states to current states and send report
127+
// readable, but with compiler warning:
128+
// if (currentButtonStates != previousButtonStates || currentHatStates != previousHatStates)
127129
if ((memcmp((const void *)currentButtonStates, (const void *)previousButtonStates, sizeof(currentButtonStates)) != 0) && (memcmp((const void *)currentHatStates, (const void *)previousHatStates, sizeof(currentHatStates)) != 0))
128130
{
129131
for (byte currentIndex = 0; currentIndex < numOfButtons; currentIndex++)

0 commit comments

Comments
 (0)