|
K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
|
#include <stdbool.h>#include <stdint.h>Data Structures | |
| struct | kfsw_lastwords |
Enumerations | |
| enum | kfsw_lastwords_reason { KFSW_LASTWORDS_NONE = 0 , KFSW_LASTWORDS_COMMANDED = 1 , KFSW_LASTWORDS_BROWNOUT = 2 , KFSW_LASTWORDS_FATAL = 3 , KFSW_LASTWORDS_STARVED = 4 , KFSW_LASTWORDS_UNKNOWN = 5 } |
Functions | |
| void | kfsw_lastwords_write (enum kfsw_lastwords_reason reason, uint32_t detail, uint32_t uptime_ms, uint32_t boot_count) |
| bool | kfsw_lastwords_take (struct kfsw_lastwords *record) |
| bool | kfsw_lastwords_withdraw (enum kfsw_lastwords_reason reason) |
| const char * | kfsw_lastwords_reason_name (enum kfsw_lastwords_reason reason) |
| int | kfsw_lastwords_watch_supply (void) |
A note written before a restart, kept in RAM that start-up does not clear.
It survives a reset but not a power loss, and a magic number and a CRC validate it.
Reset reason.
| const char * kfsw_lastwords_reason_name | ( | enum kfsw_lastwords_reason | reason | ) |
Human-readable name for a reason, for the shell and the log.
| bool kfsw_lastwords_take | ( | struct kfsw_lastwords * | record | ) |
Read the note and clear it.
Returns true when a valid note was found. Returns false without clearing the note if another operation owns it.
| int kfsw_lastwords_watch_supply | ( | void | ) |
Start the supply voltage detector.
Returns 0 when a detector is armed, or -ENOTSUP when the SoC has none.
| bool kfsw_lastwords_withdraw | ( | enum kfsw_lastwords_reason | reason | ) |
Clear the note if its reason matches.
Returns true when it was cleared. Returns false if another operation owns the record.
| void kfsw_lastwords_write | ( | enum kfsw_lastwords_reason | reason, |
| uint32_t | detail, | ||
| uint32_t | uptime_ms, | ||
| uint32_t | boot_count | ||
| ) |
Write a note without waiting, including from an interrupt.
A concurrent or nested operation is ignored while another owns the record. Sequential writes replace the previous note; there is no severity arbitration.