Wykres commitów

18 Commity (master)

Autor SHA1 Wiadomość Data
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
StevenCellist ca2a3073b9
[LoRaWAN] Change and upgrade persistence handling (#1017)
* [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
2024-03-18 08:51:38 +01:00
StevenCellist 5766d386af
[LoRaWAN] Improve persistence behaviour, add dwell time error, clear up debug output (#980)
* [LoRaWAN] Improve examples, add getter for DevAddr

* [ArduinoHAL] Only (over)write new values

* [HAL] Fix comment

* [TypeDef] Introduce error for LoRaWAN dwell time

* [LoRaWAN] Improve persistence behaviour, add dwell time error, clear up debug output

* [LoRaWAN] Prevent incorrect behaviour in restore()

* [LoRaWAN] Improve example comments and persistence

* [LoRaWAN] Fix DeviceTime and LinkCheck, fix FcntUp offset

* [LoRaWAN] Fix example incorrectly processing MAC commands

* [LoRaWAN] Fix downlink port, Fcnt 'underflow', user MAC processing

* [LoRaWAN] Add simple receive methods

* [LoRaWAN] Add co-author

Co-Authored-By: HeadBoffin <60431281+HeadBoffin@users.noreply.github.com>

* [LoRaWAN] Fix example output

* [LoRaWAN] Improve persistence behaviour, bugfix subband

* [LoRaWAN] Prevent useless rejoin during nonpersistent session

* [LoRaWAN] Graciously block an uplink if not joined

---------

Co-authored-by: HeadBoffin <60431281+HeadBoffin@users.noreply.github.com>
2024-02-27 17:29:45 +01:00
jgromes 4aadd7aab2 [HAL] Fixed unused variable warnings 2023-11-18 16:56:45 +01:00
StevenCellist 82258105b7
[LoRaWAN] Rework bands, official Rx windows, support ADR, confirm frames, improve EEPROM handling, support clock drift (#867)
* [LoRaWAN] rework bands, add ADR, partial MAC support

Known problem: terribly bad at receiving downlinks
Mask-list bands (e.g. US915) untested, likely a few bugs

* [LoRaWAN] Change Rx windows from CAD to RxSingle

* [LoRaWAN] improve persistence, better Rx windows, wear leveling, confirmed frames

* [LoRaWAN] Module-independent (OTAA) Rx windows, fix confirming downlinks

* [LoRaWAN] Implement SX127x support, fix MAC uplinking, support clock drift

* [ArduinoHal] fix clock drift calculation

* [LoRaWAN] Improve band & ADR logic, allow setting ADR, DR, subband, update examples

* [LoRaWAN] Fix EU868 coding rate, improve example

* [LoRaWAN] fix unused channel index

* [LoRaWAN] fix merge issue (deleted line)

* [LoRaWAN] fix CSMA calling now incorrect function

* [LoRaWAN] fix include logic

* [LoRaWAN] fix warnings, remove duplicate function

* [LoRaWAN] improve examples, add unified sendReceive, bugfixes, add FSK

* [LoRaWAN] improve examples

* [LoRaWAN] add new keywords, add debug guard

* [SX127x] Updated startReceive interface to be more in line with SX126x

* [SX127x] Added public method to convert from bytes to symbols

* [LoRaWAN] Update start receive for SX127x

* Added note about LoRaWAN beta

* [SX127x] Fixed potential float overflow

---------

Co-authored-by: jgromes <jan.gromes@gmail.com>
2023-11-12 14:02:39 +01:00
Nico Maas f691b11c38
Fixed Persistent Storage Issue for RP2040 with Arduino Pico Framework (#868)
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
2023-11-04 16:09:13 +01:00
jgromes 912333c408 [HAL] Added check for defined ESP version macro (#860) 2023-10-28 21:54:31 +02:00
Lewis He 039fa0fc59
Update api adapt esp core 3.0.0-alpha2 (#860) 2023-10-28 19:41:51 +02:00
jgromes 4e0ed033db [HAL] Fixed persistent storage on Sparkfun Apollo (#848) 2023-10-15 08:48:37 +02:00
jgromes 7de4a4693e [HAL] Disable EEPROM on Arduino Due 2023-09-15 18:10:47 +02:00
jgromes 414e338505 Fixed ESP32 platform detection 2023-08-29 21:57:51 +02:00
jgromes e486829b8f [HAL] Implemented basic persistent storage 2023-07-06 11:19:18 +02:00
jgromes a01b02fae2 [MOD] Rework for buffered SPI (#776) 2023-06-26 19:36:45 +02:00
jgromes 7a99aa0ef4 [HAL] Use compact Doxygen and stop using reserved format 2023-04-22 18:53:30 +02:00
jgromes 37bb8af768 [HAL] Fixed formatting 2023-04-22 18:08:08 +02:00
Mestery 9a68a3c901 use uint32 instead of uint8 for pin type 2023-04-16 21:39:00 +02:00
Mestery d8f0d36407
fix 2023-04-13 17:50:27 +02:00
Mestery ec3d4eaf20 Improve hardware abstraction layer 2023-04-12 23:16:18 +02:00