Browse Source

fix malformed if/else stmts in IRRemote.cpp

main
John Robinson 3 years ago
parent
commit
daa7cc5a30
No known key found for this signature in database
1 changed files with 20 additions and 17 deletions
  1. +20
    -17
      libraries/IRremote/IRremote.cpp

+ 20
- 17
libraries/IRremote/IRremote.cpp View File

DBG_PRINT(TICKS_HIGH(desired), DEC); DBG_PRINT(TICKS_HIGH(desired), DEC);


bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired))); bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
if (passed)
DBG_PRINTLN(F("?; passed"));
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
if (passed) {
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
} }


//+======================================================== //+========================================================
DBG_PRINT(measured_ticks * USECPERTICK, DEC); DBG_PRINT(measured_ticks * USECPERTICK, DEC);
DBG_PRINT(F("us vs ")); DBG_PRINT(F("us vs "));
DBG_PRINT(desired_us, DEC); DBG_PRINT(desired_us, DEC);
DBG_PRINT("us");
DBG_PRINT("us");
DBG_PRINT(": "); DBG_PRINT(": ");
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC); DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
DBG_PRINT(F(" <= ")); DBG_PRINT(F(" <= "));


bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS)) bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS))); && (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
if (passed)
DBG_PRINTLN(F("?; passed"));
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
if (passed) {
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
} }


//+======================================================== //+========================================================
DBG_PRINT(measured_ticks * USECPERTICK, DEC); DBG_PRINT(measured_ticks * USECPERTICK, DEC);
DBG_PRINT(F("us vs ")); DBG_PRINT(F("us vs "));
DBG_PRINT(desired_us, DEC); DBG_PRINT(desired_us, DEC);
DBG_PRINT("us");
DBG_PRINT("us");
DBG_PRINT(": "); DBG_PRINT(": ");
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC); DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
DBG_PRINT(F(" <= ")); DBG_PRINT(F(" <= "));


bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS)) bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS))); && (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
if (passed)
DBG_PRINTLN(F("?; passed"));
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
if (passed) {
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
} }


//+============================================================================= //+=============================================================================

Loading…
Cancel
Save