I'm having a problem executing blink on Core 1. My ESP is the WeMos Lolin32 Lite. Tried to modify the priority, the task handler, add vTaskStartScheduler() in the end of code, all without success. Here's the code:
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#define BLINK_GPIO 22
void blink_task(void *param)
{
gpio_pad_select_gpio(BLINK_GPIO);
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
while(1)
{
gpio_set_level(BLINK_GPIO, 0);
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_set_level(BLINK_GPIO, 1);
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
void app_main()
{
xTaskCreatePinnedToCore(blink_task, "Blink", 1000, NULL, 20, NULL, 0);
}