Skip to content

Commit

Permalink
fix $ST bug couldn't set with all leading zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
lincomatic committed Apr 3, 2018
1 parent 81e06e4 commit 03a689c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions firmware/open_evse/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions firmware/open_evse/rapi_proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 03a689c

Please sign in to comment.