RadioLib/examples
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
..
AFSK [AFSK] Added SX126x to examples 2023-02-11 14:12:55 +01:00
APRS [LR11x0] Added direct mode support 2024-04-20 18:05:31 +02:00
AX25 [LR11x0] Added direct mode support 2024-04-20 18:05:31 +02:00
BellModem/BellModem_Transmit [Bell] Added Bell modem example 2023-04-30 10:18:50 +02:00
CC1101 Added getPacketLength to examples (#214) 2023-07-15 19:36:23 +02:00
FSK4 [AFSK] Added SX126x to examples 2023-02-11 14:12:55 +01:00
Hellschreiber Added LR11x0 to supported protocols 2024-04-20 18:07:27 +02:00
LR11x0 [LR11x0] Added support for LR-FHSS 2024-04-21 15:01:57 +02:00
LoRaWAN Updated board definitions for the LoRaWAN Examples (#1052) 2024-04-14 08:15:50 +02:00
Morse [LR11x0] Added direct mode support 2024-04-20 18:05:31 +02:00
NonArduino Use RadioLibTime_t (aka unsigned long) when dealing with millis() and micros() (#1075) 2024-04-25 21:50:58 +02:00
Pager [Pager] Added note about module pin 2023-05-08 20:12:51 +02:00
PhysicalLayer/PhysicalLayer_Interface [PHY] Added interface showcase example (#773) 2023-06-21 22:25:31 +02:00
RF69 Added getPacketLength to examples (#214) 2023-07-15 19:36:23 +02:00
RTTY Added LR11x0 to supported protocols 2024-04-20 18:07:27 +02:00
SSTV [AFSK] Added SX126x to examples 2023-02-11 14:12:55 +01:00
STM32WLx [STM32WL] Fixed output power for modules without LP (#798) 2023-07-16 15:50:26 +02:00
SX123x [SX123x] Added support for SX1233 (#898) 2023-12-09 15:34:56 +01:00
SX126x Added ESP IRAM attribute to examples (#1010) 2024-03-10 20:40:41 +01:00
SX127x Added ESP IRAM attribute to examples (#1010) 2024-03-10 20:40:41 +01:00
SX128x Added getPacketLength to examples (#214) 2023-07-15 19:36:23 +02:00
Si443x Added getPacketLength to examples (#214) 2023-07-15 19:36:23 +02:00
Stream Removed remaining enable interrupt (#657) 2023-01-07 22:31:20 +01:00
nRF24 Added getPacketLength to examples (#214) 2023-07-15 19:36:23 +02:00