Question regarding core usage on the esp32 with Arduino esp-now example
Posted: Thu Jan 10, 2019 5:33 pm
Hi, I am currently working with the esp-now example code that was available in the Arduino code examples after downloading the Espressif addon. I thought I remember reading somewhere that the program is set up such that one of the esp cores is dedicated to running/managing the wireless communication hardware, and the second core is available for whatever code you write in the Arduino IDE. I can't seem to find any confirmation on this, however. Does anyone here know if this is the case?
When the "OnDataRecv" callback function runs, I want it to put the data it received in a global queue to be processed by code in the main loop(). If the entire program is running on one core, then I think just disabling interrupts around the part where the main loop gets the data from the queue should be enough to avoid a possible race condition where the callback function writes data at the same time. If however the callback function was called from code on a different core, I'm not sure if using interrupts like this still works, hence my question. Thanks!
When the "OnDataRecv" callback function runs, I want it to put the data it received in a global queue to be processed by code in the main loop(). If the entire program is running on one core, then I think just disabling interrupts around the part where the main loop gets the data from the queue should be enough to avoid a possible race condition where the callback function writes data at the same time. If however the callback function was called from code on a different core, I'm not sure if using interrupts like this still works, hence my question. Thanks!