From a0f59ef2ecddb6bfac5ad737ca26e880b4dc28bf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 21 May 2022 12:28:21 +0200 Subject: [PATCH] Add more logging to Shelly 3EM Add more logging to Shelly 3EM (#13515) --- tasmota/xnrg_23_ade7880.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasmota/xnrg_23_ade7880.ino b/tasmota/xnrg_23_ade7880.ino index a05baa88a..7adacaa97 100644 --- a/tasmota/xnrg_23_ade7880.ino +++ b/tasmota/xnrg_23_ade7880.ino @@ -476,6 +476,7 @@ void Ade7880Cycle(void) { #endif // ADE7880_PROFILING uint32_t status0 = Ade7880ReadVerify(ADE7880_STATUS0); // 0xE502 - 0x000FEFE0 +/* if (!bitRead(status0, 5)) { // LENERGY AddLog(LOG_LEVEL_DEBUG, PSTR("A78: Unexpected ISR0 0x%08X"), status0); return; @@ -483,6 +484,13 @@ void Ade7880Cycle(void) { Ade7880WriteVerify(ADE7880_STATUS0, 0x00000020); // 0xE502 - Acknowledge LENERGY - Reset IRQ0 line status0 = Ade7880ReadVerify(ADE7880_STATUS0); // 0xE502 - 0x000FEFC0 } +*/ + if (!bitRead(status0, 5)) { // LENERGY + AddLog(LOG_LEVEL_DEBUG, PSTR("A78: Unexpected ISR0 0x%08X"), status0); + } + Ade7880WriteVerify(ADE7880_STATUS0, 0x00000020); // 0xE502 - Acknowledge LENERGY - Reset IRQ0 line + status0 = Ade7880ReadVerify(ADE7880_STATUS0); // 0xE502 - 0x000FEFC0 + if (Ade7880.cycle_count) { // Allow calibration stabilization Ade7880.cycle_count--; return; // Skip first cycles