ESP32 has two cores which can run in parallel. This link explain how to set and use them, in arduino IDE:
I would like to do the same for B4R. I found a reference to this function in the file "task.h" which is in this address "C:\Users\dudu\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\tools\sdk\include\freertos\freertos\task.h"
In file esp32_hal.h here C:\Users\dudu\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\esp32-hal.h
I found this:
I think the last function should be used.
Can anybody help with defining the inline c for this function ? I'm lost...
ESP32 Dual Core with Arduino IDE | Random Nerd Tutorials
The ESP32 is dual core: it comes with 2 microprocessors. In this article we’ll show you how to use both ESP32 cores using Arduino IDE by creating tasks.
randomnerdtutorials.com
B4X:
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
static inline IRAM_ATTR BaseType_t xTaskCreate(
TaskFunction_t pvTaskCode,
const char * const pcName,
const uint32_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pvCreatedTask)
{
return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY );
}
#endif
In file esp32_hal.h here C:\Users\dudu\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\esp32-hal.h
I found this:
B4X:
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
//allows to easily handle all possible situations without repetitive code
BaseType_t xTaskCreateUniversal( TaskFunction_t pxTaskCode,
const char * const pcName,
const uint32_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask,
const BaseType_t xCoreID );
I think the last function should be used.
Can anybody help with defining the inline c for this function ? I'm lost...
Last edited: