ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
FreeRTOS Utilities

Data Structures

struct  rtos_instance_t
 Instance of a FreeRTOS task. More...
 

Functions

BaseType_t task_create (TaskFunction_t pxTaskCode, rtos_instance_t *inst, void *const pvParameters)
 Create a FreeRTOS task using the provided instance parameters.
 
void log_watermark (const rtos_instance_t *const inst)
 Log the high-water mark (stack usage in bytes) of a FreeRTOS task.
 
void log_info (const rtos_instance_t *const inst)
 Log general task information in a human-readable way.
 

Core Definitions

CPU core identifiers

#define CORE0   (0)
 CPU core 0.
 
#define CORE1   (1)
 CPU core 1.
 

General Macros

#define WORD_LEN_BYTE   (4)
 Word length in bytes.
 
#define NOT_SET   (255)
 Default uninitialized value.
 

Detailed Description

A collection of useful ESP-IDF FreeRTOS wrappers.


Data Structure Documentation

◆ rtos_instance_t

struct rtos_instance_t

Instance of a FreeRTOS task.

Stores the task handle and its configuration parameters.

Data Fields
const BaseType_t CORE CPU core for pinning the task.
const UBaseType_t PRIORITY Task priority.
const uint32_t STACK_SIZE Task stack size in words.
const char *const TAG Tag used for logging.
TaskHandle_t task_handle FreeRTOS task handle.

Macro Definition Documentation

◆ CORE0

#define CORE0   (0)

CPU core 0.

◆ CORE1

#define CORE1   (1)

CPU core 1.

◆ NOT_SET

#define NOT_SET   (255)

Default uninitialized value.

◆ WORD_LEN_BYTE

#define WORD_LEN_BYTE   (4)

Word length in bytes.

Function Documentation

◆ log_info()

void log_info ( const rtos_instance_t *const inst)

Log general task information in a human-readable way.

The following information is logged:

  • Core ID.
  • Current state.
  • Current priority level.
  • Current high-water mark.
Parameters
instPointer to the rtos_instance_t structure.
Note
Pass NULL if calling this function from within the task itself.

◆ log_watermark()

void log_watermark ( const rtos_instance_t *const inst)

Log the high-water mark (stack usage in bytes) of a FreeRTOS task.

Uses FreeRTOS uxTaskGetStackHighWaterMark() internally.

See also
uxTaskGetStackHighWaterMark() from FreeRTOS for more details.
Parameters
instPointer to the rtos_instance_t structure.
Note
Pass NULL if calling this function from within the task itself.

◆ task_create()

BaseType_t task_create ( TaskFunction_t pxTaskCode,
rtos_instance_t * inst,
void *const pvParameters )

Create a FreeRTOS task using the provided instance parameters.

Uses FreeRTOS xTaskCreatePinnedToCore() internally.

See also
xTaskCreatePinnedToCore() from FreeRTOS for more details.
Parameters
[in]pxTaskCodePointer to the task function.
[in,out]instPointer to a preconfigured rtos_instance_t structure.
[in]pvParametersParameters to pass to the task function.
Returns
Any BaseType_t value from xTaskCreatePinnedToCore().