#include "Arduino_FreeRTOS.h"
#define configCHECK_FOR_STACK_OVERFLOW 2
TaskHandle_t task_handle1;
// void vApplicationStackOverflowHook( TaskHandle_t xTask,
// signed char *pcTaskName ) {
void vApplicationStackOverflowHook( TaskHandle_t xTask __attribute__ ((unused)),
char * pcTaskName __attribute__ ((unused)) ) {
Serial.print("stack overflow at: ");
Serial.println(pcTaskName);
Serial.flush();
for (;;) {}
}
void task(void *p) {
for (;;) {
vTaskDelay(100);
}
}
void setup() {
Serial.begin(115200);
xTaskCreate(task, "task1", 36, NULL, 1, &task_handle1);
}
void loop() {}