summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-02-15 14:16:31 +1100
committerDamien George <damien@micropython.org>2023-02-15 14:16:31 +1100
commitfe330c74f430a006cb54fff250ed22d7038fb6d0 (patch)
treea515f3c35df19ae5c2f0234195990da72d117eb8
parente1f211c6b503a0ad8246b289447e9985e629601c (diff)
extmod/utime_mphal: Fix comment re delta range check in time_ticks_add.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--extmod/utime_mphal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/utime_mphal.c b/extmod/utime_mphal.c
index cd91c9553..9cd5d938d 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"));
}