ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
rtos_utils.h
Go to the documentation of this file.
1
24
25#ifndef __RTOS_UTILS_H__
26#define __RTOS_UTILS_H__
27
28#include "freertos/FreeRTOS.h"
29#include "freertos/task.h"
30#include "esp_log.h"
31
39
44#define CORE0 (0)
45#define CORE1 (1)
47
51#define WORD_LEN_BYTE (4)
52#define NOT_SET (255)
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
64typedef struct {
65 TaskHandle_t task_handle;
66 const uint32_t STACK_SIZE;
67 const BaseType_t CORE;
68 const UBaseType_t PRIORITY;
69 const char *const TAG;
71
85BaseType_t task_create(
86 TaskFunction_t pxTaskCode,
87 rtos_instance_t *inst,
88 void *const pvParameters
89);
90
102void log_watermark(const rtos_instance_t *const inst);
103
120void log_info(const rtos_instance_t *const inst);
121
122#ifdef __cplusplus
123}
124#endif
125 // end of rtos_utils group
127
128#endif // __RTOS_UTILS_H__
129
const BaseType_t CORE
CPU core for pinning the task.
Definition rtos_utils.h:67
const char *const TAG
Tag used for logging.
Definition rtos_utils.h:69
const uint32_t STACK_SIZE
Task stack size in words.
Definition rtos_utils.h:66
TaskHandle_t task_handle
FreeRTOS task handle.
Definition rtos_utils.h:65
const UBaseType_t PRIORITY
Task priority.
Definition rtos_utils.h:68
BaseType_t task_create(TaskFunction_t pxTaskCode, rtos_instance_t *inst, void *const pvParameters)
Create a FreeRTOS task using the provided instance parameters.
Definition rtos_utils.c:39
void log_watermark(const rtos_instance_t *const inst)
Log the high-water mark (stack usage in bytes) of a FreeRTOS task.
Definition rtos_utils.c:55
void log_info(const rtos_instance_t *const inst)
Log general task information in a human-readable way.
Definition rtos_utils.c:66
Instance of a FreeRTOS task.
Definition rtos_utils.h:64