From 985f682a60fe44ba5e737c03ded3b3f2a9465366 Mon Sep 17 00:00:00 2001 From: lincomatic Date: Mon, 8 Feb 2021 18:09:26 -0800 Subject: [PATCH] fix crash caused by PR#134 --- firmware/open_evse/CHANGELOG | 4 ++++ firmware/open_evse/open_evse.ino | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firmware/open_evse/CHANGELOG b/firmware/open_evse/CHANGELOG index 7511a3a6..234cae6d 100644 --- a/firmware/open_evse/CHANGELOG +++ b/firmware/open_evse/CHANGELOG @@ -1,5 +1,9 @@ Change Log +202100208 SCL V7.1.2 +- fix spontaneous reboot caused by PR#134 RAPI_BTN code + -> when button disabled, didn't pat the watchdog before m_Btn.read() + 20210111 SCL V7.1.1 - added ECVF_TIME_LIMIT, ECVF_CHARGE_LIMIT - move ECVF_AMMETER_CAL to 0x8000 diff --git a/firmware/open_evse/open_evse.ino b/firmware/open_evse/open_evse.ino index bd164082..438a4712 100644 --- a/firmware/open_evse/open_evse.ino +++ b/firmware/open_evse/open_evse.ino @@ -2186,9 +2186,11 @@ int8_t BtnHandler::DoShortPress(int8_t infaultstate) void BtnHandler::ChkBtn() { + WDT_RESET(); + m_Btn.read(); + if (!g_EvseController.ButtonIsEnabled()) { #ifdef RAPI_BTN - m_Btn.read(); if (m_Btn.shortPress()) { RapiSendButtonPress(0); } else if (m_Btn.longPress()) { @@ -2198,11 +2200,8 @@ void BtnHandler::ChkBtn() return; } - WDT_RESET(); - int8_t infaultstate = g_EvseController.InFaultState(); - m_Btn.read(); if (m_Btn.shortPress()) { if (DoShortPress(infaultstate)) { goto longpress;