|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The fault log under its cap. More...
Functions | |
| static card_dir_t | fault_level (void *ctx, const char *dir) |
| One level of BENCH, through the caller's make_dir(). | |
| static fault_log_t | clear_tmp (const fault_log_io_t *io) |
| A RCBENCH.TMP still standing: left by a power cut during a rotation, or by a removal the card refused. | |
| static fault_log_t | rotate (const fault_log_io_t *io) |
| The full file renamed to RCBENCH.OLD, with no TMP standing. | |
| fault_log_t | fault_log_note (const fault_log_io_t *io, const char *line, bool *rotated) |
Append line to the fault log, renamed to RCBENCH.OLD first when the line and its line feed would take it past FAULT_LOG_CAP. rotated, when not NULL, says whether that rename happened. | |
|
static |
A RCBENCH.TMP still standing: left by a power cut during a rotation, or by a removal the card refused.
With an OLD beside it the TMP is the older of the two and goes; without one it is the OLD and takes the name. Until it is gone no line is written, so the card holds at most the OLD and the TMP, 2MiB.
| io | The card functions. |
|
static |
One level of BENCH, through the caller's make_dir().
A card_make_fn, so its context stays a plain pointer.
| ctx | The fault_log_io_t the caller passed. |
| dir | The folder path to make. |
| fault_log_t fault_log_note | ( | const fault_log_io_t * | io, |
| const char * | line, | ||
| bool * | rotated ) |
Append line to the fault log, renamed to RCBENCH.OLD first when the line and its line feed would take it past FAULT_LOG_CAP. rotated, when not NULL, says whether that rename happened.
| io | The card functions. |
| line | The line to append, without its line feed. |
| rotated | Receives true when the file was renamed, or NULL. |
|
static |
The full file renamed to RCBENCH.OLD, with no TMP standing.
FAT renames onto no file, so the old OLD is moved to RCBENCH.TMP first and removed only after the rename has gone through; a rename that fails gives it its name back. A TMP the card does not remove fails the rotation after the fact: the line waits for clear_tmp().
| io | The card functions. |