I want to use the FreeRTOS method xTaskCreatePinnedToCore() from task.h however when I use
#include <task.h>
I get the compilation error
error: ‘xTaskCreatePinnedToCore’ was not declared in this scope
Is it possible to do this without using the ESP32 module?
I want to have a task running to receive data from the SX126x LoRa chip whilst the main loop is concerned with sending data
I accept that this might not be the best way to achieve my desired outcome, I want to receive data and send data, so it might be simpler (or even preferred) to perform the send operation after receiving data.
xTaskCreatePinnedToCore is not defined for RAK4631, because the Nordic nRF52 has only one core (The ESP32 has two cores), so the command makes no sense.
It is not a good idea to run concurrent running tasks for sending and receiving, unless you use semaphores to block the other task while a sending or receiving is ongoing.
What you can do is (assuming you use LoRa P2P)
Put LoRa transceiver in receive mode
When packet is ready to send, put LoRa transceiver into send mode and send the packet
When callback TX Done or TX Error is called handle the result
After handling event, put LoRa transceiver back to receive mode
When you are using LoRaWAN protocol, receiving is only possible after a TX was done.
Of course: I’d actually answered the question myself already. It was 3am here and I think I’d just thought myself into a corner. That will teach me to try and “get it finished”