Skip to content

Commit d317140

Browse files
author
Alain FLAISCHER
committed
Add explicit long int conversion in msleep function
1 parent baa90fc commit d317140

File tree

1 file changed

+2
-2
lines changed
  • sdk/userspace/include/utils

1 file changed

+2
-2
lines changed

sdk/userspace/include/utils/lcd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ extern "C" {
4646
static inline int msleep(uint64_t ms)
4747
{
4848
struct timespec sleep_time = {
49-
.tv_sec = ms / MS_PER_SECOND,
50-
.tv_nsec = (ms % MS_PER_SECOND) * NS_PER_MS
49+
.tv_sec = (long int)(ms / MS_PER_SECOND),
50+
.tv_nsec = (long int)((ms % MS_PER_SECOND) * NS_PER_MS)
5151
};
5252

5353
return clock_nanosleep(CLOCK_MONOTONIC, 0, &sleep_time, NULL);

0 commit comments

Comments
 (0)