Commit graph

13 commits

Author SHA1 Message Date
jgromes
b675e0c034 Fix RPi example flags 2024-05-03 21:05:44 +01:00
Elizabeth Myers
205031550b
Use RadioLibTime_t (aka unsigned long) when dealing with millis() and micros() (#1075)
* Use unsigned long when dealing with millis() and micros().

Although sizeof(uint32_t) == sizeof(unsigned long) on Arduino, this is
not the case on 64-bit Linux, where sizeof(unsigned long) ==
sizeof(uint64_t).

Most timestamp arithmetic and comparisons have been left alone, to
reduce code churn. This is fine, as uint32_t is perfectly wide to store
most timestamp deltas this library will deal with, and C will promote
the integer rather than do a narrowing conversion. The real problem
arises with narrowing conversions being done by assuming timestamps are
32-bit.

No functional changes intended for platforms where sizeof(uint32_t) ==
sizeof(unsigned long) (so most 8/16/32-bit platforms).

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

* Change most timestamps to use RadioLibTime_t.

This makes it obvious what is and isn't a timestamp.

Not everything has been converted; anything dealing with protocol and
chip-level timestamps has been left alone on purpose, to make it clear
that these functions do require 32-bit timestamps.

No functional changes intended on platforms where sizeof(uint32_t) ==
sizeof(unsigned long).

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

* Use uint32_t internally in getTimeOnAir.

We need to not overflow the integers with the shifts and
multiplications, so this is correct behaviour.

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

---------

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>
2024-04-25 21:50:58 +02:00
jgromes
46ef20ebe9 Fix interrupt emulation in Raspberry Pi example 2024-04-14 14:37:55 +01:00
jgromes
a4dbae03a3 [MOD] Fixed missing cast (#776) 2023-06-26 19:41:12 +02:00
jgromes
f4f11a35d3 [Mod] Updated examples to use buffered SPI (#776) 2023-06-26 19:39:10 +02:00
jgromes
b02a5c1867 Updated raspberry example 2023-05-18 20:52:28 +01:00
jgromes
1a55220020 Updated non-Arduino example 2023-05-16 17:12:45 +01:00
jgromes
a797bef0d2 Fixed term order for RPi example 2023-05-07 07:17:47 +01:00
jgromes
32cef2699d Update Raspberry example 2023-05-06 18:34:41 +01:00
jgromes
a21cabf3e3 Make build scripts executable 2023-05-06 18:02:12 +01:00
jgromes
e1853ddf04 Added CMake for NonArduino example 2023-04-30 22:10:48 +02:00
jgromes
d5fe5e3e2d [HAL] Cleaned up example and added comments 2023-04-22 18:07:47 +02:00
Mestery
94050efb1b add example 2023-04-18 19:21:01 +02:00