Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markirb authored and root committed Dec 6, 2024
1 parent c54cb8f commit d1db815
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BL0942/shelly_pm_bl0942.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ bool BL0942PowerMeter::ReadReg(uint8_t reg, uint8_t *rx_buf, size_t len) {
uint8_t chksum = tx_buf[0] + tx_buf[1];
for (int i = 0; i < len - 1; i++) {
chksum += rx_buf[i];
LOG(LL_ERROR, "%08X", rx_buf[i]);
LOG(LL_ERROR, ("%08X", rx_buf[i]));
}
chksum ^= 0xFF;

if (read_len != len || rx_buf[len - 1] != chksum) {
LOG(LL_ERROR, "wrong checksum");
LOG(LL_ERROR, ("wrong checksum") );
return false;
}
return true;
Expand Down

0 comments on commit d1db815

Please sign in to comment.