diff --git a/firmware/open_evse/CHANGELOG b/firmware/open_evse/CHANGELOG index 9963e349..b386c2ca 100644 --- a/firmware/open_evse/CHANGELOG +++ b/firmware/open_evse/CHANGELOG @@ -1,5 +1,10 @@ Change Log +20180328 SCL +- fixed bug: $ST command would clear timer instead of setting it if all + 4 parameters had leading zeros + e.g. $ST 01 05 02 01 + 20180323 SCL - added PERIODIC_LCD_REFRESH_MS code for Glyn Hudson, currently disabled -> redraw of LCD at periodic intervals, in case it gets corrupted diff --git a/firmware/open_evse/rapi_proc.cpp b/firmware/open_evse/rapi_proc.cpp index 0f3f3429..b752aca6 100644 --- a/firmware/open_evse/rapi_proc.cpp +++ b/firmware/open_evse/rapi_proc.cpp @@ -485,12 +485,16 @@ int EvseRapiProcessor::processCmd() case 'T': // timer if (tokenCnt == 5) { extern DelayTimer g_DelayTimer; - if ((*tokens[1] == '0') && (*tokens[2] == '0') && (*tokens[3] == '0') && (*tokens[4] == '0')) { + u1.u8 = (uint8_t)dtou32(tokens[1]); + u2.u8 = (uint8_t)dtou32(tokens[2]); + u3.u8 = (uint8_t)dtou32(tokens[3]); + u4.u8 = (uint8_t)dtou32(tokens[4]); + if ((u1.u8 == 0) && (u2.u8 == 0) && (u3.u8 == 0) && (u4.u8 == 0)) { g_DelayTimer.Disable(); } else { - g_DelayTimer.SetStartTimer(dtou32(tokens[1]),dtou32(tokens[2])); - g_DelayTimer.SetStopTimer(dtou32(tokens[3]),dtou32(tokens[4])); + g_DelayTimer.SetStartTimer(u1.u8,u2.u8); + g_DelayTimer.SetStopTimer(u3.u8,u4.u8); g_DelayTimer.Enable(); } rc = 0;