Skip to content

Commit

Permalink
build: C++20 compatibility
Browse files Browse the repository at this point in the history
A small fix to remove "volatile ++" build warning.
Source: crankyoldgit#2040
  • Loading branch information
zehnm committed Feb 5, 2025
1 parent 7b8c178 commit c4d24f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void USE_IRAM_ATTR gpio_intr() {
else
params.rawbuf[rawlen] = (now - start) / kRawTick;
}
params.rawlen++;
params.rawlen = params.rawlen + 1; // C++20 fix

start = now;

Expand Down Expand Up @@ -540,8 +540,8 @@ void IRrecv::crudeNoiseFilter(decode_results *results, const uint16_t floor) {
for (uint16_t i = offset + 2; i <= results->rawlen && i < kBufSize; i++)
results->rawbuf[i - 2] = results->rawbuf[i];
if (offset > 1) { // There is a previous pair we can add to.
// Merge this pair into into the previous space.
results->rawbuf[offset - 1] += addition;
// Merge this pair into into the previous space. // C++20 fix applied
results->rawbuf[offset - 1] = results->rawbuf[offset - 1] + addition;
}
results->rawlen -= 2; // Adjust the length.
} else {
Expand Down

0 comments on commit c4d24f7

Please sign in to comment.