From 01ca5f5cfb0eb504150bf95957f49c84cdb038fe Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 10 Aug 2019 18:12:25 +0200 Subject: [PATCH] Refactor code Refactor code --- sonoff/xsns_06_dht.ino | 5 +++-- sonoff/xsns_49_solaxX1.ino | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sonoff/xsns_06_dht.ino b/sonoff/xsns_06_dht.ino index 06b2dddff..69e543ab8 100644 --- a/sonoff/xsns_06_dht.ino +++ b/sonoff/xsns_06_dht.ino @@ -125,8 +125,9 @@ bool DhtRead(uint8_t sensor) uint8_t checksum = (dht_data[0] + dht_data[1] + dht_data[2] + dht_data[3]) & 0xFF; if (dht_data[4] != checksum) { - AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DHT D_CHECKSUM_FAILURE " %02X, %02X, %02X, %02X, %02X =? %02X"), - dht_data[0], dht_data[1], dht_data[2], dht_data[3], dht_data[4], checksum); + char hex_char[15]; + AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DHT D_CHECKSUM_FAILURE " %s =? %02X"), + ToHex(dht_data, 5, hex_char, sizeof(hex_char), ' '), checksum); return false; } diff --git a/sonoff/xsns_49_solaxX1.ino b/sonoff/xsns_49_solaxX1.ino index b9a114fc3..72583484f 100644 --- a/sonoff/xsns_49_solaxX1.ino +++ b/sonoff/xsns_49_solaxX1.ino @@ -353,11 +353,7 @@ void solaxX1_Update(void) // Every Second } else { - /* char hexCar[2]; - for(int i=0; i