Browse Source

fix requested changes

used tabs instead of spaces,
change variable name to the one which is more uniform across the project,
fixed bug about condition always being true
rfm69
Darsh Patel 6 years ago
committed by GitHub
parent
commit
01bd5dad04
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      code/espurna/ir.ino

+ 5
- 4
code/espurna/ir.ino View File

@ -14,7 +14,7 @@ Copyright (C) 2017-2018 by François Déchery
IRrecv * _ir_recv;
decode_results _ir_results;
unsigned long last = millis();
unsigned long _ir_last = millis();
// -----------------------------------------------------------------------------
// PRIVATE
// -----------------------------------------------------------------------------
@ -43,11 +43,12 @@ void _irProcessCode(unsigned long code) {
relayStatus(0, button_value);
}
if (button_mode == IR_BUTTON_MODE_TOGGLE) {
if (millis() - last > 250){
relayToggle(button_value);
if (millis() - _ir_last > 250){
relayToggle(button_value);
_ir_last = millis();
}
else{
DEBUG_MSG_P(PSTR("[IR] Ignoring repeated code\n"));
DEBUG_MSG_P(PSTR("[IR] Ignoring repeated code\n"));
}
}
#if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE


Loading…
Cancel
Save