#include "esp_common.h"
void taskConnect(void *pData) {
printf("Hello from taskConnect!\n");
int count = 0;
while(1) {
count++;
printf("count - %d\n", count);
//taskYIELD();
vTaskDelay(10);
}
vTaskDelete(NULL);
printf("Task end\n");
}
void user_init(void) {
UART_SetBaudrate(0,115200);
printf("SDK version:%s\n", system_get_sdk_version());
printf("user_init running ...\n");
wifi_set_opmode(NULL_MODE);
xTaskCreate(taskConnect, "taskConnect", 200, NULL, 3, NULL);
}
When it starts, it creates a task (taskConnect). I see the taskConnect task run for about 20 iterrations and then my ESP8266 resets with a WDT timer reset. I had assumed that the vTaskDelay() would have allowed the scheduler to give the rest of the ESP8266 the time it needed to do its work ... but it seems I am missing some concept. Has anyone walked this path before and have any advice to offer?