* 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>
* [LoRaWAN] Change and upgrade persistence handling
* [BuildOpt] Patch to upstream
* [LoRaWAN] Fix#1018
* [LoRaWAN] Remove outdated parts
* [LoRaWAN] Resolve feedback
Warning: untested - am not at my desk
* [LoRaWAN] Small bugfixes
RP2040 does not have an EEPROM but always uses the last 4K chunk of the flash for a software EEPROM - if used. It is exactly handled as ESP32 "SoftEEPROMs", meaning it does copy the "flashEEPROM" to memory on .begin(); and does need to commit(); to write it back. We saw in the past that a node could successfully get an OTAA on an RP2040, but could never join - due to the missing commit and wrong init, this was the reason. As the "SoftEEPROM" is always written at the end of the flash, it also survives an Arduino Sketch reflash if not wiped afterwards by node.wipe(); More info and documentation here: https://arduino-pico.readthedocs.io/en/latest/eeprom.html