Fix cppcheck issues (#1036)
Fixes the following cppcheck issues: examples/SecretKnockSensor/SecretKnockSensor.ino 305 variableScope 398 style The scope of the variable 'timeDiff' can be reduced. examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino 127 variableScope 398 style The scope of the variable 'led_state' can be reduced.
This commit is contained in:
@@ -302,8 +302,7 @@ bool validateKnock()
|
||||
less of a pain to use if you're tempo is a little slow or fast.
|
||||
*/
|
||||
int totaltimeDifferences = 0;
|
||||
int timeDiff = 0;
|
||||
for (i=0; i < maximumKnocks; i++) { // Normalize the times
|
||||
for (int timeDiff = 0, i=0; i < maximumKnocks; i++) { // Normalize the times
|
||||
knockReadings[i]= map(knockReadings[i], 0, maxKnockInterval, 0, 100);
|
||||
timeDiff = abs(knockReadings[i] - secretCode[i]);
|
||||
if (timeDiff >
|
||||
|
||||
Reference in New Issue
Block a user