Skip to content

Commit c4d24f7

Browse files
committed
build: C++20 compatibility
A small fix to remove "volatile ++" build warning. Source: crankyoldgit#2040
1 parent 7b8c178 commit c4d24f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/IRrecv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static void USE_IRAM_ATTR gpio_intr() {
219219
else
220220
params.rawbuf[rawlen] = (now - start) / kRawTick;
221221
}
222-
params.rawlen++;
222+
params.rawlen = params.rawlen + 1; // C++20 fix
223223

224224
start = now;
225225

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

0 commit comments

Comments
 (0)