rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
fw_boot.h
1
/*
2
* The first start after an update: keep the new build, or go back.
3
*
4
* The bootloader is built with rollback: a build's first start is a trial
5
* (pending verify), and a restart while it still is starts the build
6
* before it. fw_boot_decide() is the order of the calls that settle the
7
* trial; the calls themselves are the panel's (fw_ota.c), so the host
8
* suite runs the order against fakes.
9
*
10
* A failed start is never kept. When marking it invalid returns -- the
11
* call restarts on success -- the panel restarts anyway, which leaves the
12
* trial unconfirmed and so goes back too. Marking a good start valid can
13
* fail: the build then runs this once, and the next start goes back.
14
*
15
* Pure C, no ESP-IDF (Espressif Internet-of-Things Development Framework).
16
*
17
* SPDX-License-Identifier: MIT
18
*/
19
20
#ifndef RCBENCH_FW_BOOT_H
21
#define RCBENCH_FW_BOOT_H
22
23
#include <stdbool.h>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
typedef
enum
{
30
FW_BOOT_NORMAL = 0,
31
FW_BOOT_UPDATED,
32
FW_BOOT_ROLLED_BACK,
33
FW_BOOT_UNCONFIRMED,
34
} fw_boot_t;
35
36
typedef
struct
{
38
bool (*
pending
)(
void
*ctx);
40
void (*
mark_invalid
)(
void
*ctx);
42
bool (*
mark_valid
)(
void
*ctx);
44
void (*
restart
)(
void
*ctx);
46
bool (*
last_invalid
)(
void
*ctx);
47
void
*ctx;
48
}
fw_boot_ops_t
;
49
59
fw_boot_t fw_boot_decide(
const
fw_boot_ops_t
*ops,
bool
ui_up,
bool
noted);
60
61
#ifdef __cplusplus
62
}
63
#endif
64
65
#endif
/* RCBENCH_FW_BOOT_H */
fw_boot_ops_t
Definition
fw_boot.h:36
fw_boot_ops_t::last_invalid
bool(*) last_invalid(void *ctx)
Definition
fw_boot.h:46
fw_boot_ops_t::mark_invalid
void(*) mark_invalid(void *ctx)
Definition
fw_boot.h:40
fw_boot_ops_t::mark_valid
bool(*) mark_valid(void *ctx)
Definition
fw_boot.h:42
fw_boot_ops_t::pending
bool(*) pending(void *ctx)
Definition
fw_boot.h:38
fw_boot_ops_t::restart
void(*) restart(void *ctx)
Definition
fw_boot.h:44
shared
fwupdate
include
fw_boot.h
Generated by
1.18.0