Skip to content

FreeRTOS delay #78

Answered by mobizt
kalu1 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use FreeRTOS as normal as this.

void setup()
{
    auto loopTask = [](void *pvParameters)
    {
        for (;;)
        {
       
            app.loop();
            Database.loop();

            if (app.ready())
            {
                //Your code here.
            }

            vTaskDelay(10 / portTICK_PERIOD_MS);
        }
    };

    xTaskCreatePinnedToCore(loopTask, "loopTask", 8000, NULL, 3, NULL, 1 /* must be core 1 for network task */);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kalu1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants