Skip to content
Commit 86a126db authored by Martin Stumpf's avatar Martin Stumpf Committed by Anas Nashif
Browse files

samples: modules: lvgl: fix integer overflow



`lv_task_handler()` returns a `uint32_t`, but `k_msleep` takes a
`int32_t`.

If no timer exists, `lv_task_handler()` returns `UINT32_MAX` to indicate
that we should wait forever. However, this gets auto-cast to `-1`,
indicating to `k_msleep` to not wait at all, creating a busy loop.

Hence, a clamping to `[0, INT32_MAX]` is required.

Signed-off-by: default avatarMartin Stumpf <finomnis@gmail.com>
parent 3eae0201
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment