Skip to content

Commit

Permalink
RadioLib: libtockHal.h: Cast time calculation to 64-bit
Browse files Browse the repository at this point in the history
To avoid overflows casts the timer to 64-bits.

Signed-off-by: Alistair Francis <[email protected]>
  • Loading branch information
alistair23 committed Dec 18, 2024
1 parent 874efe2 commit fd45549
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RadioLib/libtockHal.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class TockRadioLibHal : public RadioLibHal {
#if !defined(RADIOLIB_CLOCK_DRIFT_MS)
return ms;
#else
return ms * 1000 / (1000 + RADIOLIB_CLOCK_DRIFT_MS);
return (uint64_t)ms * 1000 / (1000 + RADIOLIB_CLOCK_DRIFT_MS);
#endif
}

Expand Down

0 comments on commit fd45549

Please sign in to comment.