Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) {
result = kUnknownStr;
} else {
auto *ptr = reinterpret_cast<const char*>(kAllProtocolNamesStr);
for (uint16_t i = 0; i <= protocol && STRLEN(ptr); i++) {
for (int i = 0; i <= protocol && STRLEN(ptr); i++) {
if (i == protocol) {
result = FPSTR(ptr);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/ir_Daikin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void IRDaikinESP::setRaw(const uint8_t new_code[], const uint16_t length) {
offset = kDaikinStateLength - kDaikinStateLengthShort;
stateReset();
}
for (uint8_t i = 0; i < length && i < kDaikinStateLength; i++)
for (uint16_t i = 0; i < length && i < kDaikinStateLength; i++)
_.raw[i + offset] = new_code[i];
}

Expand Down
4 changes: 2 additions & 2 deletions src/ir_Kelvinator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ uint8_t IRKelvinatorAC::calcBlockChecksum(const uint8_t *block,
const uint16_t length) {
uint8_t sum = kKelvinatorChecksumStart;
// Sum the lower half of the first 4 bytes of this block.
for (uint8_t i = 0; i < 4 && i < length - 1; i++, block++)
for (uint16_t i = 0; i < 4 && i + 1 < length; i++, block++)
sum += (*block & 0b1111);
// then sum the upper half of the next 3 bytes.
for (uint8_t i = 4; i < length - 1; i++, block++) sum += (*block >> 4);
for (uint16_t i = 4; i + 1 < length; i++, block++) sum += (*block >> 4);
// Trim it down to fit into the 4 bits allowed. i.e. Mod 16.
return sum & 0b1111;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ir_Mitsubishi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ void IRMitsubishi136::checksum(void) {
bool IRMitsubishi136::validChecksum(const uint8_t *data, const uint16_t len) {
if (len < kMitsubishi136StateLength) return false;
const uint16_t half = (len - kMitsubishi136PowerByte) / 2;
for (uint8_t i = 0; i < half; i++) {
for (uint16_t i = 0; i < half; i++) {
// This variable is needed to avoid the warning: (known compiler issue)
// warning: comparison of promoted ~unsigned with unsigned [-Wsign-compare]
const uint8_t inverted = ~data[kMitsubishi136PowerByte + half + i];
Expand Down
6 changes: 3 additions & 3 deletions src/ir_Panasonic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,9 @@ bool IRrecv::decodePanasonicAC32(decode_results *results, uint16_t offset,
uint32_t prev_section_data;

// Match all the expected data blocks.
for (uint16_t block = 0;
block < sections * blocks_per_section;
block++) {
const uint32_t total_blocks =
static_cast<uint32_t>(sections) * blocks_per_section;
for (uint32_t block = 0; block < total_blocks; block++) {
prev_section_data = section_data;
uint16_t used = matchGeneric(results->rawbuf + offset, &section_data,
results->rawlen - offset, bits_per_block * 2,
Expand Down
6 changes: 4 additions & 2 deletions src/ir_Pronto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ void IRsend::sendPronto(uint16_t data[], uint16_t len, uint16_t repeat) {
// Check we have enough data to send the complete first sequence.
if (seq_1_len + seq_1_start > len) return;
// Send the contents of the 1st sequence.
for (uint16_t i = seq_1_start; i < seq_1_start + seq_1_len; i += 2) {
const uint32_t seq_1_end = static_cast<uint32_t>(seq_1_start) + seq_1_len;
for (uint32_t i = seq_1_start; i < seq_1_end; i += 2) {
mark((data[i] * periodic_time_x10) / 10);
space((data[i + 1] * periodic_time_x10) / 10);
}
Expand All @@ -98,8 +99,9 @@ void IRsend::sendPronto(uint16_t data[], uint16_t len, uint16_t repeat) {
if (seq_2_len + seq_2_start > len) return;

// Send the contents of the 2nd sequence.
const uint32_t seq_2_end = static_cast<uint32_t>(seq_2_start) + seq_2_len;
for (uint16_t r = 0; r < repeat; r++)
for (uint16_t i = seq_2_start; i < seq_2_start + seq_2_len; i += 2) {
for (uint32_t i = seq_2_start; i < seq_2_end; i += 2) {
mark((data[i] * periodic_time_x10) / 10);
space((data[i + 1] * periodic_time_x10) / 10);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ir_Samsung.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ void IRSamsungAc::setRaw(const uint8_t new_code[], const uint16_t length) {
_Sleep = _.Sleep5 && _.Sleep12;
_OnTimer = _getOnTimer();
_OffTimer = _getOffTimer();
for (uint8_t i = kSamsungAcStateLength; i < length; i++)
for (uint16_t i = kSamsungAcStateLength; i < length; i++)
_.raw[i - kSamsungAcSectionLength] = _.raw[i];
}
}
Expand Down Expand Up @@ -962,7 +962,7 @@ bool IRrecv::decodeSamsungAC(decode_results *results, uint16_t offset,
if (!matchMark(results->rawbuf[offset++], kSamsungAcBitMark)) return false;
if (!matchSpace(results->rawbuf[offset++], kSamsungAcHdrSpace)) return false;
// Section(s)
for (uint16_t pos = 0; pos <= (nbits / 8) - kSamsungAcSectionLength;
for (uint16_t pos = 0; pos + kSamsungAcSectionLength <= nbits / 8;
pos += kSamsungAcSectionLength) {
uint16_t used;
// Section Header + Section Data (7 bytes) + Section Footer
Expand Down
Loading