diff --git a/extmod/utime_mphal.c b/extmod/utime_mphal.c index cd91c95530cb..9cd5d938d0f9 100644 --- a/extmod/utime_mphal.c +++ b/extmod/utime_mphal.c @@ -103,7 +103,7 @@ STATIC mp_obj_t time_ticks_add(mp_obj_t ticks_in, mp_obj_t delta_in) { // The latter requires excluding delta=-TICKS_PERIOD/2. // // This unsigned comparison is equivalent to a signed comparison of: - // delta <= TICKS_PERIOD/2 || delta >= TICKS_PERIOD/2 + // delta <= -TICKS_PERIOD/2 || delta >= TICKS_PERIOD/2 if (delta + MICROPY_PY_UTIME_TICKS_PERIOD / 2 - 1 >= MICROPY_PY_UTIME_TICKS_PERIOD - 1) { mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("ticks interval overflow")); }