Expand description
Error Ring Buffer for Network Initialization
Circular buffer that captures initialization errors and debug logs for display in the bootstrap UI. Also drains and forwards entries from the network crate’s internal debug ring buffer.
§Design
- Fixed-size, no_std compatible (no heap allocation for buffer)
- Lock-free for single-producer single-consumer pattern
- Overwrites oldest entries when full
- Includes stage/source tracking for categorization
Structs§
- Single log entry in the ring buffer
Enums§
- Stage identifiers for error categorization
Constants§
- Maximum message length in bytes
- Number of entries in the ring buffer (power of 2 for efficient modulo)
Statics§
- Static ring buffer storage
- READ_
POS 🔒Read position (wraps around) - Total entries written (for overflow detection)
- Write position (wraps around)
Functions§
- Log a debug/info message to the ring buffer
- Drain entries from the network crate’s debug ring buffer and forward them to our error ring buffer.
- Log an error message to the ring buffer
- Check how many entries are available to read
- Clear the ring buffer
- Get total number of entries ever written (for overflow detection)
- Pop the oldest entry from the ring buffer