|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
When a new build's first start is kept: the steps the start waits for, and the bound on the wait. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | fw_trial_t |
| One trial: the steps seen and whether it is settled. More... | |
Enumerations | |
| enum | fw_trial_verdict_t { FW_TRIAL_OPEN = 0 , FW_TRIAL_KEEP , FW_TRIAL_KEEP_BOUND , FW_TRIAL_SETTLED } |
| What fw_trial_poll() decides. More... | |
Functions | |
| void | fw_trial_init (fw_trial_t *t, uint32_t start_ms) |
| Start a trial with no step seen. | |
| void | fw_trial_mark (fw_trial_t *t, uint32_t steps) |
| Record steps as seen. FW_TRIAL_TICK counts only once FW_TRIAL_FRAME is seen, before this call or in it; bits outside FW_TRIAL_ALL are ignored. | |
| void | fw_trial_settle (fw_trial_t *t) |
| Settle the trial outside this model, as the start without touch does; every later poll says FW_TRIAL_SETTLED. | |
| fw_trial_verdict_t | fw_trial_poll (fw_trial_t *t, uint32_t now_ms, bool quiet) |
Decide at now_ms. FW_TRIAL_KEEP and FW_TRIAL_KEEP_BOUND settle the trial: each is returned once. | |
| uint32_t | fw_trial_missing (const fw_trial_t *t) |
| The steps not seen yet. | |
When a new build's first start is kept: the steps the start waits for, and the bound on the wait.
The bootloader starts a new build once on trial (pending verify). A reset while it still is, by a panic, a watchdog, a restart or a power cut, starts the build before it. This model says when the trial is settled in the build's favour: once every step in FW_TRIAL_ALL is seen, or, FW_TRIAL_BOUND_MS after the start, once the screen loop is ticking. Either way only on a quiet bench, because keeping the build writes otadata and a flash write stalls both cores.
The steps:
No step waits for the IOmcu: a panel without one is kept the same way.
Pure C, no ESP-IDF (Espressif Internet-of-Things Development Framework). The panel's calls are firmware/panel/main/panel_trial.c.
SPDX-License-Identifier: MIT
| enum fw_trial_verdict_t |
What fw_trial_poll() decides.
| void fw_trial_init | ( | fw_trial_t * | t, |
| uint32_t | start_ms ) |
Start a trial with no step seen.
| t | The trial. |
| start_ms | The millisecond count the bound counts from. |
| void fw_trial_mark | ( | fw_trial_t * | t, |
| uint32_t | steps ) |
Record steps as seen. FW_TRIAL_TICK counts only once FW_TRIAL_FRAME is seen, before this call or in it; bits outside FW_TRIAL_ALL are ignored.
| t | The trial. |
| steps | One or more FW_TRIAL_* steps. |
| uint32_t fw_trial_missing | ( | const fw_trial_t * | t | ) |
The steps not seen yet.
| t | The trial. |
| fw_trial_verdict_t fw_trial_poll | ( | fw_trial_t * | t, |
| uint32_t | now_ms, | ||
| bool | quiet ) |
Decide at now_ms. FW_TRIAL_KEEP and FW_TRIAL_KEEP_BOUND settle the trial: each is returned once.
| t | The trial. |
| now_ms | The millisecond count; it may wrap past 2^32. |
| quiet | Whether the bench can take a flash write now. |
| void fw_trial_settle | ( | fw_trial_t * | t | ) |
Settle the trial outside this model, as the start without touch does; every later poll says FW_TRIAL_SETTLED.
| t | The trial. |