* tock: use native time getter, remove globals
Tock has direct support for querying time. The prior `millis()`
method here replicated the same functionality, but missed some
corner case concerns around overflow/wrapping. Instead, just use
the native Tock time getter method. This also removes unneeded
global variables and methods.
* NonArduino/Tock: Update to latest libtock-c
Update to the latest libtock-c commit. libtock-c now includes a
libtockHal.h, so we can use that instead of the version here.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
---------
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com>
* [HAL] Move HALs to src
* [CI] Temporarily drop unofficial STM32 (package down)
* [LR11x0] Fix ambiguous call
* [CI] Return Maple mini back to build matrix
* examples/NonArduino/Tock: Support building for RISC-V
Signed-off-by: Alistair Francis <alistair@alistair23.me>
* examples/NonArduino/Tock: Update to newer libtock-c
Signed-off-by: Alistair Francis <alistair@alistair23.me>
---------
Signed-off-by: Alistair Francis <alistair@alistair23.me>
* 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>
The Tock specific version of libgcc is built to be position independent,
so use that instead of the one supplied by the compiler. This fixes a
few odd corner cases when using printf().
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Add support for running RadioLib on Tock.
Tock is an embedded operating system designed for running multiple
concurrent, mutually distrustful applications on Cortex-M and RISC-V
based embedded platforms (https://github.com/tock/tock).
This PR uses libtock-c (https://github.com/tock/libtock-c) to add
support to running RadioLib as a Tock userspace application.
This has been tested on the SparkFun LoRa Thing Plus - expLoRaBLE board
(https://github.com/tock/tock/tree/master/boards/apollo3/lora_things_plus)
but will work on any LoRa compatible Tock board (currently only the
expLoRaBLE board).
Signed-off-by: Alistair Francis <alistair@alistair23.me>