Skip to content

Commit fd45549

Browse files
committed
RadioLib: libtockHal.h: Cast time calculation to 64-bit
To avoid overflows casts the timer to 64-bits. Signed-off-by: Alistair Francis <[email protected]>
1 parent 874efe2 commit fd45549

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

RadioLib/libtockHal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class TockRadioLibHal : public RadioLibHal {
169169
#if !defined(RADIOLIB_CLOCK_DRIFT_MS)
170170
return ms;
171171
#else
172-
return ms * 1000 / (1000 + RADIOLIB_CLOCK_DRIFT_MS);
172+
return (uint64_t)ms * 1000 / (1000 + RADIOLIB_CLOCK_DRIFT_MS);
173173
#endif
174174
}
175175

0 commit comments

Comments
 (0)