summaryrefslogtreecommitdiff
path: root/extmod/moduselect.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-02-01 13:12:23 +1100
committerDamien George <damien@micropython.org>2021-02-16 14:59:19 +1100
commitfce0bd1a2af5aebd81d30d79b50210c80f768bc4 (patch)
treebed2e586006235b8cfcb3b77472bb0ba7f5c1348 /extmod/moduselect.c
parenta1a28157993756255eca067acb23145b08151546 (diff)
extmod/moduselect: Fix unsigned/signed comparison for timeout!=-1.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/moduselect.c')
-rw-r--r--extmod/moduselect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/moduselect.c b/extmod/moduselect.c
index 80beb8e09..6d8249f42 100644
--- a/extmod/moduselect.c
+++ b/extmod/moduselect.c
@@ -148,7 +148,7 @@ STATIC mp_obj_t select_select(size_t n_args, const mp_obj_t *args) {
// poll the objects
mp_uint_t n_ready = poll_map_poll(&poll_map, rwx_len);
- if (n_ready > 0 || (timeout != -1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
+ if (n_ready > 0 || (timeout != (mp_uint_t)-1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
// one or more objects are ready, or we had a timeout
mp_obj_t list_array[3];
list_array[0] = mp_obj_new_list(rwx_len[0], NULL);
@@ -250,7 +250,7 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
for (;;) {
// poll the objects
n_ready = poll_map_poll(&self->poll_map, NULL);
- if (n_ready > 0 || (timeout != -1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
+ if (n_ready > 0 || (timeout != (mp_uint_t)-1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
break;
}
MICROPY_EVENT_POLL_HOOK