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>
Hi,
I am getting a compile error on ESP-IDF/Platformio:
```
managed_components/RadioLib/src/protocols/LoRaWAN/LoRaWAN.cpp: In member function 'int16_t LoRaWANNode::beginOTAA(uint64_t, uint64_t, uint8_t*, uint8_t*, bool)':
managed_components/RadioLib/src/protocols/LoRaWAN/LoRaWAN.cpp:125:61: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses]
125 | if(joinAcceptMsgEnc[0] & RADIOLIB_LORAWAN_MHDR_MTYPE_MASK != RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_ACCEPT) {
cc1plus: some warnings being treated as errors
*** [.pio/build/TTGO-LoRa32-v1/managed_components/RadioLib/src/protocols/LoRaWAN/LoRaWAN.o] Error 1
I propose adding a parenthesis, for clarity and compatibility.
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>
Instead of getting the status from the very first byte in the input
buffer, which will be what we read when we send the first byte. Let's
instead get the status from the first byte after the command. This
provides a more accurate status value.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
The SX126x get status command returns a single status byte. The status
byte is automatically read in the `Module::SPItransferStream()` function
when we increment buffLen (see
https://github.com/jgromes/RadioLib/blob/master/src/Module.cpp#L259).
By setting numBytes we incorrectly end up reading 2 bytes. Instead set
numBytes to zero so we only read the single status byte.
Signed-off-by: Alistair Francis <alistair@alistair23.me>