Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 949 Bytes

File metadata and controls

44 lines (36 loc) · 949 Bytes

Learning Objectives

  • Use FreeRTOS APIs to create a task.

Concepts

Task Functions

FreeRTOS Tasks are implemented as C functions which must have the following prototype:

void TaskFunction( void *pvParameters );

Each task normally runs forever within an infinite loop, and does not exit. The structure of a typical task is shown below:

void TaskFunction( void *pvParameters )
{
    /* A task is normally implemented as an infinite loop. */
    for( ;; )
    {
        /* The code to implement the task functionality goes here. */
    }
}

Steps

  1. Complete all the TODOs in the source/tutorials/tutorial_2/source/tutorial_2.c file.

  2. Execute the following commands from the root of the repository to build:

    rm -rf build
    mkdir build
    cd build
    cmake -B . -S ../source/ -DTUTORIAL=2
    make
  3. Execute the following command to run the binary:

    ./freertos_example