Skip to content

Commit fe330c7

Browse files
committed
extmod/utime_mphal: Fix comment re delta range check in time_ticks_add.
Signed-off-by: Damien George <damien@micropython.org>
1 parent e1f211c commit fe330c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extmod/utime_mphal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ STATIC mp_obj_t time_ticks_add(mp_obj_t ticks_in, mp_obj_t delta_in) {
103103
// The latter requires excluding delta=-TICKS_PERIOD/2.
104104
//
105105
// This unsigned comparison is equivalent to a signed comparison of:
106-
// delta <= TICKS_PERIOD/2 || delta >= TICKS_PERIOD/2
106+
// delta <= -TICKS_PERIOD/2 || delta >= TICKS_PERIOD/2
107107
if (delta + MICROPY_PY_UTIME_TICKS_PERIOD / 2 - 1 >= MICROPY_PY_UTIME_TICKS_PERIOD - 1) {
108108
mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("ticks interval overflow"));
109109
}

0 commit comments

Comments
 (0)