|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Reset reason, restart, shutdown handlers, and heap information. More...
Namespaces | |
| namespace | idfxx |
Enumerations | |
| enum class | idfxx::reset_reason : int { idfxx::reset_reason::unknown = 0 , idfxx::reset_reason::power_on = 1 , idfxx::reset_reason::external = 2 , idfxx::reset_reason::software = 3 , idfxx::reset_reason::panic = 4 , idfxx::reset_reason::interrupt_watchdog = 5 , idfxx::reset_reason::task_watchdog = 6 , idfxx::reset_reason::watchdog = 7 , idfxx::reset_reason::deep_sleep = 8 , idfxx::reset_reason::brownout = 9 , idfxx::reset_reason::sdio = 10 , idfxx::reset_reason::usb = 11 , idfxx::reset_reason::jtag = 12 , idfxx::reset_reason::efuse = 13 , idfxx::reset_reason::power_glitch = 14 , idfxx::reset_reason::cpu_lockup = 15 } |
| Reason for the most recent chip reset. More... | |
Functions | |
| std::string | idfxx::to_string (reset_reason r) |
| Returns a string representation of a reset reason. | |
| reset_reason | idfxx::last_reset_reason () noexcept |
| Returns the reason for the most recent chip reset. | |
| void | idfxx::restart () |
| Restart the chip immediately. | |
| void | idfxx::register_shutdown_handler (void(*handler)()) |
| Registers a function to be called during chip shutdown/restart. | |
| void | idfxx::unregister_shutdown_handler (void(*handler)()) |
| Unregisters a previously registered shutdown handler. | |
| result< void > | idfxx::try_register_shutdown_handler (void(*handler)()) |
| Registers a function to be called during chip shutdown/restart. | |
| result< void > | idfxx::try_unregister_shutdown_handler (void(*handler)()) |
| Unregisters a previously registered shutdown handler. | |
| std::size_t | idfxx::free_heap_size () noexcept |
| Returns the current free heap size in bytes. | |
| std::size_t | idfxx::free_internal_heap_size () noexcept |
| Returns the current free internal heap size in bytes. | |
| std::size_t | idfxx::minimum_free_heap_size () noexcept |
| Returns the minimum free heap size recorded since boot. | |
Reset reason, restart, shutdown handlers, and heap information.
|
strong |
Reason for the most recent chip reset.
Definition at line 38 of file system.hpp.
|
inlinenoexcept |
Returns the current free heap size in bytes.
Definition at line 147 of file system.hpp.
|
inlinenoexcept |
Returns the current free internal heap size in bytes.
Internal memory is directly accessible by the CPU and is typically used for performance-critical allocations.
Definition at line 159 of file system.hpp.
|
inlinenoexcept |
Returns the reason for the most recent chip reset.
Definition at line 72 of file system.hpp.
|
inlinenoexcept |
Returns the minimum free heap size recorded since boot.
This is the "high water mark" — the lowest free heap level reached at any point during execution. Useful for diagnosing memory pressure.
Definition at line 171 of file system.hpp.
Registers a function to be called during chip shutdown/restart.
Shutdown handlers are called in reverse order of registration when esp_restart() is invoked.
| handler | Function pointer to the shutdown handler. |
| std::system_error | on failure. |
|
inline |
Restart the chip immediately.
Performs a software reset. This function does not return. Registered shutdown handlers are called before the restart occurs.
Definition at line 82 of file system.hpp.
| std::string idfxx::to_string | ( | reset_reason | r | ) |
Returns a string representation of a reset reason.
| r | The reset reason to convert. |
Registers a function to be called during chip shutdown/restart.
Shutdown handlers are called in reverse order of registration when esp_restart() is invoked.
| handler | Function pointer to the shutdown handler. |
| idfxx::errc::invalid_state | if the handler was already registered. |
Unregisters a previously registered shutdown handler.
| handler | Function pointer to the shutdown handler to remove. |
| idfxx::errc::invalid_state | if the handler was not registered. |
Unregisters a previously registered shutdown handler.
| handler | Function pointer to the shutdown handler to remove. |
| std::system_error | on failure. |