rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
panel_trial.c File Reference

A new build's first start, kept once the panel works as a whole: see panel_trial.h and shared/fwupdate/fw_trial.h. More...

#include "panel_trial.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include "fw_ota.h"
#include "fw_trial.h"
#include "panel.h"
#include "panel_main.h"
#include "rcbench_version.h"
#include "ui_screen.h"
#include "ui_text.h"

Functions

static void report (fw_boot_t r, const char *other)
 The band's line for what the start check found. On the splash it waits in s_boot_alert for the hand-over; after it, it shows at once.
static fw_boot_t check (bool ui_up)
 Run the start check and report it.
void panel_trial_begin (bool ui_up)
 Settle the start's check at the display and touch step.
void panel_trial_mark (uint32_t steps)
 Record start-up steps (FW_TRIAL_CARD, FW_TRIAL_SETTINGS) from app_main.
static void name_missing (uint32_t missing, char *out, size_t cap)
 The steps not seen, by name, for the console.
void panel_trial_frame (bool flushed, bool quiet)
 Once per pass of the screen loop, after the flip: keep the build when fw_trial_poll() says so.

Variables

static const char * TAG = "rcbench"
 The console tag the panel's start-up lines carry.
atomic_bool s_trial_control_ran
 The control task finished one pass; set by that task.
atomic_bool s_trial_logger_ran
 The logger task finished one pass; set by that task.
static fw_trial_t s_trial
 This start's trial; app_main's task only: bring_up(), app_main and the screen loop.

Detailed Description

A new build's first start, kept once the panel works as a whole: see panel_trial.h and shared/fwupdate/fw_trial.h.

bring_up() settles the check at the display and touch step: without either, a trial start goes back at once. With both up the trial stays open through the card, the settings, the control and logger tasks and the first frame, and the screen loop keeps the build from panel_trial_frame(). A panic or reset before that starts the build before it.

Built with -D RCBENCH_TRIAL_CRASH=ON, a trial start aborts at the moment it would be kept, before the check and before any line that says it was kept, for a check on the bench that a start which fails late goes back. A start that is no trial runs as any other.

SPDX-License-Identifier: MIT

Function Documentation

◆ check()

fw_boot_t check ( bool ui_up)
static

Run the start check and report it.

Parameters
ui_upWhether the display and touch came up.
Returns
What the check found: FW_BOOT_UPDATED for a trial start it kept.

◆ name_missing()

void name_missing ( uint32_t missing,
char * out,
size_t cap )
static

The steps not seen, by name, for the console.

Parameters
missingFW_TRIAL_* bits.
outWhere the names go.
capBytes at out.

◆ panel_trial_begin()

void panel_trial_begin ( bool ui_up)

Settle the start's check at the display and touch step.

Without the display or touch (ui_up false) a trial start goes back to the build before it here and does not return. A start that is no trial is settled here too: the band's line for a build that went back. A trial start with both up stays on trial until panel_trial_frame() keeps it.

Parameters
ui_upWhether the display and touch came up.

◆ panel_trial_frame()

void panel_trial_frame ( bool flushed,
bool quiet )

Once per pass of the screen loop, after the flip: keep the build when fw_trial_poll() says so.

Parameters
flushedWhether this pass's frame reached the display.
quietWhether the bench can take a flash write now (flash_gate_open(), as the settings save asks).

◆ panel_trial_mark()

void panel_trial_mark ( uint32_t steps)

Record start-up steps (FW_TRIAL_CARD, FW_TRIAL_SETTINGS) from app_main.

Parameters
stepsOne or more FW_TRIAL_* steps.

◆ report()

void report ( fw_boot_t r,
const char * other )
static

The band's line for what the start check found. On the splash it waits in s_boot_alert for the hand-over; after it, it shows at once.

Parameters
rThe check's result.
otherThe written build's version, for FW_BOOT_ROLLED_BACK.