15#include "freertos/FreeRTOS.h"
16#include "freertos/task.h"
17#include "freertos/portmacro.h"
38 if(xPortInIsrContext() == pdFALSE)
40 *millis = xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
44 *millis = xTaskGetTickCountFromISR() * (1000 / configTICK_RATE_HZ);
67 if (!ptr || size == 0)
72 *ptr = pvPortMalloc(size);
98 if (!ptr || num == 0 || size == 0)
103 *ptr = pvPortMalloc(size);
109 memset(*ptr, 0, num * size);
152 return xPortGetFreeHeapSize();
173#ifdef configUSE_TRACE_FACILITY
174 TaskStatus_t xTaskDetails;
175 vTaskGetInfo(NULL, &xTaskDetails, pdTRUE, eInvalid);
176 *task_id = xTaskDetails.xTaskNumber << 8 | xTaskDetails.uxCurrentPriority;
meshx_err_t
MeshX Error Codes.
Logging interface for MeshX with color-coded output.
#define MESHX_LOGD(module_id, format,...)
Utility functions for RTOS operations in the MeshX framework.
meshx_err_t meshx_rtos_get_sys_time(unsigned int *millis)
Retrieves the current system time in milliseconds.
meshx_err_t meshx_rtos_get_curr_task_id_prio(unsigned int *task_id)
Retrieves the current task ID.
meshx_err_t meshx_rtos_calloc(void **ptr, size_t num, size_t size)
Allocates memory for an array of elements and initializes it to zero.
meshx_err_t meshx_rtos_free(void **ptr)
Frees memory allocated to a pointer and sets it to NULL.
meshx_err_t meshx_rtos_malloc(void **ptr, size_t size)
Allocates memory dynamically in a thread-safe manner using FreeRTOS.
size_t meshx_rtos_get_free_heap(void)
Retrieves the amount of free heap memory available in the system.