67typedef enum : uint32_t {
155#ifndef APP_LAUNCH_SETTINGS
157#define APP_LAUNCH_SETTINGS (1)
165typedef enum : uint16_t {
175typedef enum : uint16_t {
256#if APP_LAUNCH_SETTINGS
414#if APP_LAUNCH_SETTINGS
462 return (depth == 0U);
489 bool handled =
false;
499#if APP_LAUNCH_SETTINGS
579#if APP_LAUNCH_SETTINGS
588 if (act ==
nullptr) {
639 ra8_log_info(
"app_launch",
"VCOM console init failed -- HIL banner unavailable");
657 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
static void app_stub_on_leave(ra8_app_t *a)
Stub on_leave: count the focus loss and log it.
static bool app_launch_switch_and_back(void)
Switch reader -> settings and back, verifying the focus + back-stack.
static ra8_app_nav_t s_nav
Navigation back-stack layered over s_reg.
static ra8_app_t s_reader_app
The core reader app instance (registered into s_reg).
app_launch_hil_t
VCOM-console line rate for the deterministic HIL success banner.
@ k_app_launch_hil_baud
VCOM console line rate (8N1).
static bool app_launch_hil_console_init(void)
Bring up the SCI8 / J-Link OB VCOM console for the HIL success banner.
static uint16_t s_nav_stack[k_app_nav_cap]
Caller-owned storage backing the navigation back-stack (app ids).
app_launch_id_t
Registered app ids (launch keys).
@ k_app_id_settings
Optional settings app (removable).
@ k_app_id_reader
Core EPUB-reader app (non-removable).
static bool app_launch_route_back(void)
Route a back-button event through the chrome to the active app.
static const uint8_t k_app_launch_pass_banner[]
Deterministic, run-to-run-stable HIL success banner (uart_scrape gate).
static app_launch_ctx_t s_reader_ctx
Stub state for the core reader app.
static app_launch_ctx_t s_settings_ctx
Stub state for the optional settings app.
static void app_launch_hil_emit_pass(void)
Emit the deterministic HIL success banner over the VCOM console.
static void app_stub_on_enter(ra8_app_t *a)
Stub on_enter: count the focus gain and log it.
static bool app_launch_selfcheck(void)
Run the whole deterministic registry + launch + back-stack surface.
static bool app_launch_enter_reader(void)
Launch the reader app from the chrome and verify first focus.
static bool app_launch_register(void)
Initialise the registry + back-stack and register every app.
static const ra8_app_vtable_t k_app_stub_vt
Shared lifecycle vtable for every stub app (behaviour keyed off ctx).
static void app_stub_render(const ra8_app_t *a)
Stub render: count the frame and log it (stands in for drawing).
static void app_launch_banner(void)
Emit the PASS banner: app count, reader enters, and the PASS line.
static bool app_stub_on_input(ra8_app_t *a, const ra8_widget_event_t *ev)
Stub on_input: count the event, consume only the "back" button.
static ra8_app_t s_settings_app
The optional settings app instance (registered into s_reg).
app_launch_const_t
Capacities + the button id the stub apps understand.
@ k_app_btn_back
Button id a chrome routes to mean "go back".
@ k_app_nav_cap
Back-stack depth (history of focused apps).
@ k_app_reg_cap
Registry storage slots (reader + settings).
Zero-heap app framework: lifecycle + static registry + launcher (#146).
ra8_err_t ra8_app_nav_init(ra8_app_nav_t *nav, ra8_app_registry_t *reg, uint16_t *storage, uint16_t cap)
Bind a navigation back-stack to a registry + caller-owned storage.
ra8_err_t ra8_app_nav_back(ra8_app_nav_t *nav, bool *out_popped)
Return to the most recently pushed app (pop the back-stack).
ra8_err_t ra8_app_register(ra8_app_registry_t *reg, ra8_app_t *app)
Register an app (calls its init once) and add it to the registry.
ra8_err_t ra8_app_nav_go(ra8_app_nav_t *nav, uint16_t id)
Focus app id, pushing the outgoing app onto the back-stack.
ra8_err_t ra8_app_count(const ra8_app_registry_t *reg, uint16_t *out_count)
Number of registered apps (for the launcher to list).
ra8_err_t ra8_app_route_input(ra8_app_registry_t *reg, const ra8_widget_event_t *ev, bool *out_handled)
Route an input event to the focused app.
ra8_err_t ra8_app_nav_depth(const ra8_app_nav_t *nav, uint16_t *out_depth)
Current back-stack depth (apps the user can still go back through).
ra8_err_t ra8_app_active(const ra8_app_registry_t *reg, ra8_app_t **out_app)
Get the currently focused app.
ra8_err_t ra8_app_render(ra8_app_registry_t *reg)
Run the focused app's render (on-target; no-op if none / NULL).
ra8_err_t ra8_app_registry_init(ra8_app_registry_t *reg, ra8_app_t **storage, uint16_t cap)
Bind a registry to caller-owned pointer storage (empty, no focus).
I/O-expander, USB, camera, external-memory, MIPI-DSI, UART console, and Ethernet portion of the EK-RA...
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
static const ra8_io_fsfmt_t * s_reg[(uint32_t) k_ra8_io_fsfmt_max]
Registered formats, in probe priority order.
static ra8_isr_slot_t s_slots[k_ra8_isr_slot_count]
Per-slot dispatch table.
Lightweight Logging Interface for ra8-firmware.
void ra8_log_init(void)
Initialise the logging backend.
#define ra8_log_info_val(tag, message, value)
RA8 log info val.
#define ra8_log_info(tag, message)
RA8 log info.
Per-app stub state: a display name + lifecycle-call counters.
uint32_t enters
Times on_enter fired.
const char * name
Display name + ITM log tag (non-NULL).
uint32_t leaves
Times on_leave fired.
uint32_t inputs
Times on_input fired.
uint32_t renders
Times render fired.
A bounded back-stack of app ids layered over a registry (zero-heap).
Fixed table of registered apps + the focused index.
One app instance + its metadata (caller-owned, static).
App lifecycle callbacks (shared by all instances of one app).