Skip to content

Commit

Permalink
Fix compilation issue when using old 8266 Arduino Frameworks. (#1640)
Browse files Browse the repository at this point in the history
* Try to add backward compatibility to older 8266 Arduino frameworks
* Add code comments to document why this has been done.
* Doesn't seem to be required as of 3.0.0 of the ESP8266 Arduino Framework/platform code.
  - The fix doesn't seem to hurt either way. 🤷 

Fixes #1639

Co-authored-by: @jimmys01
  • Loading branch information
crankyoldgit authored Oct 16, 2021
1 parent df27ef5 commit 9f79edd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ String uint64ToString(uint64_t input, uint8_t base) {
/// @returns A String representation of the integer.
String int64ToString(int64_t input, uint8_t base) {
if (input < 0) {
return kDashStr + uint64ToString(-input, base);
// Using String(kDashStr) to keep compatible with old arduino
// frameworks. Not needed with 3.0.2.
///> @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1639#issuecomment-944906016
return String(kDashStr) + uint64ToString(-input, base);
}
return uint64ToString(input, base);
}
Expand Down
6 changes: 5 additions & 1 deletion src/ir_Coolix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,11 @@ String IRCoolixAC::toString(void) const {
result += addBoolToString(getZoneFollow(), kZoneFollowStr);
result += addLabeledString(
(getSensorTemp() == kCoolixSensorTempIgnoreCode)
? kOffStr : uint64ToString(getSensorTemp()) + 'C', kSensorTempStr);
// Encasing with String(blah) to keep compatible with old arduino
// frameworks. Not needed with 3.0.2.
///> @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1639#issuecomment-944906016
? kOffStr : String(uint64ToString(getSensorTemp()) + 'C'),
kSensorTempStr);
return result;
}

Expand Down

0 comments on commit 9f79edd

Please sign in to comment.