theme: use FLOOR rounding for digital clock themes

the default rounding method allows for a value of 60 when setting the
seconds on a clock

fix T5639
This commit is contained in:
Mike Blumenkrantz 2017-06-30 14:59:21 -04:00
parent c2fde93c9e
commit bae9321c39
2 changed files with 5 additions and 4 deletions

View File

@ -114,7 +114,8 @@ group { name: "e/modules/clock/digital";
date(year, month, day, yearday, weekday, hour, minute, second);
dosec = get_int(do_seconds);
if (dosec) {
v = round(second);
v = round(second, FLOOR);
v = v % 60;
tim = timer(1.0 - (second - v), "clock_cb", 1);
// set seconds to v
valset("s0", v / 10);
@ -581,7 +582,7 @@ group { name: "e/modules/clock/main";
date(year, month, day, yearday, weekday, hour, minute, second);
dosec = get_int(do_seconds);
if (dosec) {
v = round(second);
v = round(second, FLOOR);
tim = timer(1.0 - (second - v), "clock_cb", 1);
custom_state(PART:"seconds", "default", 0.0);

View File

@ -276,7 +276,7 @@ group { name: "e/gadget/clock/digital";
#endif
dosec = get_int(do_seconds);
if (dosec) {
v = round(second);
v = round(second, FLOOR);
tim = timer(1.0 - (second - v), "clock_cb", 1);
// set seconds to v
valset("s0", v / 10);
@ -792,7 +792,7 @@ group { name: "e/gadget/clock/analog";
#endif
dosec = get_int(do_seconds);
if (dosec) {
v = round(second);
v = round(second, FLOOR);
tim = timer(1.0 - (second - v), "clock_cb", 1);
custom_state(PART:"seconds", "default", 0.0);