System utilities for diagnostics, memory, stack usage, and tracing. More...
#include <string>#include <cstring>#include <unordered_map>
Include dependency graph for utility.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| void | printTaskStackSizes () |
| Print stack high watermark for all FreeRTOS tasks. | |
| void | printHeapInfo () |
| Print heap size and minimum ever free heap. | |
| void | printSystemMemoryInfo () |
| Print stack and heap usage together. | |
| std::string | toLower (std::string str) |
| Convert string to lowercase. | |
| void | runTimeStats () |
| Display task priorities, stack usage, and heap stats. | |
| void | printActivePCBs () |
| Print number of active lwIP TCP PCBs. | |
| void | logSystemStats () |
| Print FreeRTOS heap and task stack status. | |
| void | printTCPState () |
| Print full lwIP statistics if available. | |
| void | printMemsize () |
| Print lwIP memory pool statistics. | |
| int | is_in_interrupt (void) |
| Check whether currently in interrupt context. | |
| void | debug_print (const char *msg) |
| Print in a mode that can be used in an ISR context. | |
| void | debug_print (const std::string &msg) |
| void | debug_print (const char *msg, size_t len) |
| void | warning (const std::string &msg) |
| void | warning (const std::string &msg, int32_t code) |
| void | rebootSystem () |
| Reboot the device immediately. | |
Provides functions to report heap, stack, and lwIP memory stats, along with runtime diagnostics. Intended for use in embedded applications.
Definition in file utility.h.
| void debug_print | ( | const char * | msg | ) |
Print in a mode that can be used in an ISR context.
Print in a mode that can be used in an ISR context.
Definition at line 184 of file utility.cpp.
Referenced by EventManager::enqueue().
Here is the caller graph for this function:| void debug_print | ( | const char * | msg, |
| size_t | len | ||
| ) |
Definition at line 203 of file utility.cpp.
| void debug_print | ( | const std::string & | msg | ) |
Definition at line 195 of file utility.cpp.
| int is_in_interrupt | ( | void | ) |
Check whether currently in interrupt context.
Check whether currently in interrupt context.
Definition at line 172 of file utility.cpp.
Referenced by EventManager::enqueue(), and EventManager::postNotification().
Here is the caller graph for this function:| void logSystemStats | ( | ) |
Print FreeRTOS heap and task stack status.
Print FreeRTOS heap and task stack status.
Definition at line 65 of file utility.cpp.
| void printActivePCBs | ( | ) |
Print number of active lwIP TCP PCBs.
Print number of active lwIP TCP PCBs.
Definition at line 142 of file utility.cpp.
References TRACE.
| void printHeapInfo | ( | ) |
Print heap size and minimum ever free heap.
Print heap size and minimum ever free heap.
Definition at line 78 of file utility.cpp.
References TRACE.
Referenced by printSystemMemoryInfo().
Here is the caller graph for this function:| void printMemsize | ( | ) |
Print lwIP memory pool statistics.
Print lwIP memory pool statistics.
Definition at line 165 of file utility.cpp.
| void printSystemMemoryInfo | ( | ) |
Print stack and heap usage together.
Print stack and heap usage together.
Definition at line 86 of file utility.cpp.
References printHeapInfo(), and printTaskStackSizes().
Here is the call graph for this function:| void printTaskStackSizes | ( | ) |
Print stack high watermark for all FreeRTOS tasks.
Print stack high watermark for all FreeRTOS tasks.
Definition at line 39 of file utility.cpp.
References TRACE.
Referenced by printSystemMemoryInfo().
Here is the caller graph for this function:| void printTCPState | ( | ) |
Print full lwIP statistics if available.
Print full lwIP statistics if available.
Definition at line 152 of file utility.cpp.
References TRACE.
| void rebootSystem | ( | ) |
This function performs a clean system reboot using the appropriate method for the platform (RP2040 or RP2350). Intended for controlled resets, such as after persistent failures or user-initiated reboots.
Definition at line 237 of file utility.cpp.
Referenced by FrameworkManager::poll().
Here is the caller graph for this function:| void runTimeStats | ( | ) |
Display task priorities, stack usage, and heap stats.
Display task priorities, stack usage, and heap stats.
Definition at line 102 of file utility.cpp.
References TRACE.
| std::string toLower | ( | std::string | str | ) |
Convert string to lowercase.
Convert string to lowercase.
Definition at line 93 of file utility.cpp.
Referenced by HttpRequest::getHeader(), and HttpParser::isChunkedEncoding().
Here is the caller graph for this function:| void warning | ( | const std::string & | msg | ) |
Definition at line 215 of file utility.cpp.
Referenced by HttpServer::run(), and Tcp::send().
Here is the caller graph for this function:| void warning | ( | const std::string & | msg, |
| int32_t | code | ||
| ) |
Definition at line 223 of file utility.cpp.