|
|
ChaosDMX
Open-Source DMX-Interface
|
#include "esp_err.h"#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | sys_chip_info_t |
| Structure to hold static chip configuration details. More... | |
Functions | |
| esp_err_t | system_init (void) |
| Initializes the system monitoring component. Sets up the internal temperature sensor and tracks initial values. | |
| float | system_get_temperature (void) |
| Gets the current internal CPU temperature. | |
| float | system_get_max_temperature (void) |
| Gets the highest recorded CPU temperature since boot. | |
| uint32_t | system_get_free_heap (void) |
| Gets the current available free heap size (RAM). | |
| uint32_t | system_get_min_free_heap (void) |
| Gets the minimum ever free heap size since boot (watermark). This is crucial for detecting close-to-OOM (Out Of Memory) conditions. | |
| uint8_t | system_get_cpu_usage (void) |
| Calculates the total real-time CPU utilization. Requires CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS to be enabled. | |
| void | system_get_tasks_list (char *buffer, size_t buffer_len) |
| Formats raw FreeRTOS statistics into a human-readable task list. Requires CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS to be enabled. Writes a table containing task names, status, priority, and remaining stack space. | |
| const char * | system_get_version (void) |
| Gets the active firmware build version. Matches the Git commit short hash (appends '-d' if local modifications exist). | |
| int64_t | system_get_uptime_ms (void) |
| Gets the system uptime since boot. | |
| int | system_get_reset_reason (void) |
| Gets the reason for the last system reset. | |
| void | system_get_chip_info (sys_chip_info_t *chip_info) |
| Retrieves static chip hardware information. | |
| void | system_print_info (void) |
| Prints a complete, formatted overview of all system statistics to the console. Internally uses ESP_LOGI or printf to output a comprehensive snapshot of the device status. | |
| void system_get_chip_info | ( | sys_chip_info_t * | chip_info | ) |
Retrieves static chip hardware information.
| [out] | chip_info | Pointer to the structure to be filled with chip details. |
Definition at line 124 of file system.c.
References sys_chip_info_t::cores, sys_chip_info_t::model_name, and sys_chip_info_t::revision.
Referenced by system_print_info().
| uint8_t system_get_cpu_usage | ( | void | ) |
Calculates the total real-time CPU utilization. Requires CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS to be enabled.
Definition at line 75 of file system.c.
Referenced by system_print_info().
| uint32_t system_get_free_heap | ( | void | ) |
Gets the current available free heap size (RAM).
Definition at line 69 of file system.c.
Referenced by system_print_info().
| float system_get_max_temperature | ( | void | ) |
Gets the highest recorded CPU temperature since boot.
Definition at line 64 of file system.c.
References max_measured_temp, and system_get_temperature().
Referenced by system_print_info().
| uint32_t system_get_min_free_heap | ( | void | ) |
Gets the minimum ever free heap size since boot (watermark). This is crucial for detecting close-to-OOM (Out Of Memory) conditions.
Definition at line 71 of file system.c.
Referenced by system_print_info().
| int system_get_reset_reason | ( | void | ) |
Gets the reason for the last system reset.
Definition at line 122 of file system.c.
Referenced by system_print_info().
| void system_get_tasks_list | ( | char * | buffer, |
| size_t | buffer_len ) |
Formats raw FreeRTOS statistics into a human-readable task list. Requires CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS to be enabled. Writes a table containing task names, status, priority, and remaining stack space.
| [out] | buffer | Destination character buffer to write the table string. |
| [in] | buffer_len | Size of the destination buffer in bytes. |
Definition at line 106 of file system.c.
Referenced by system_print_info().
| float system_get_temperature | ( | void | ) |
Gets the current internal CPU temperature.
Definition at line 50 of file system.c.
References max_measured_temp, and temp_sensor.
Referenced by system_get_max_temperature(), and system_print_info().
| int64_t system_get_uptime_ms | ( | void | ) |
Gets the system uptime since boot.
Definition at line 120 of file system.c.
Referenced by system_print_info().
| const char * system_get_version | ( | void | ) |
Gets the active firmware build version. Matches the Git commit short hash (appends '-d' if local modifications exist).
Definition at line 118 of file system.c.
Referenced by system_print_info().
| esp_err_t system_init | ( | void | ) |
Initializes the system monitoring component. Sets up the internal temperature sensor and tracks initial values.
Definition at line 27 of file system.c.
References LOGE, LOGI, LOGW, max_measured_temp, and temp_sensor.
Referenced by app_main().
| void system_print_info | ( | void | ) |
Prints a complete, formatted overview of all system statistics to the console. Internally uses ESP_LOGI or printf to output a comprehensive snapshot of the device status.
Definition at line 162 of file system.c.
References sys_chip_info_t::cores, LOGI, sys_chip_info_t::model_name, sys_chip_info_t::revision, system_get_chip_info(), system_get_cpu_usage(), system_get_free_heap(), system_get_max_temperature(), system_get_min_free_heap(), system_get_reset_reason(), system_get_tasks_list(), system_get_temperature(), system_get_uptime_ms(), and system_get_version().
Referenced by app_main().