ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
run_loop_t Struct Reference

The whole run's mutable state, threaded through the phase helpers. More...

#include <emu_run_internal.h>

Collaboration diagram for run_loop_t:

Data Fields

const emu_run_cfg_tcfg
 Setup products (engine, image, CLI knobs).
run_guards_t guards
 Env-tunable budgets + stop conditions.
uint16_t panel_w
 Firmware render width in pixels.
uint16_t panel_h
 Firmware render height in pixels.
uint16_t disp_w
 Displayed width (rotation-swapped).
uint16_t disp_h
 Displayed height (rotation-swapped).
uint16_t comp_w
 Composite (panel + sidebar) width.
uint16_t comp_h
 Composite (panel + sidebar) height.
emu_presentation_workspace_tpresentation
 Owned raw-fd presentation surface.
board_view_storage_t view_storage
 Caller-owned live-view handle storage.
board_view_tview
 Live window (NULL when headless).
board_overlay_btn_t click_btn
 Classified –click target button.
bool click_was_tab
 –click landed on a console tab.
int reboot_count
 –reboot warm reboots remaining.
uint32_t run_pc
 Current resume PC.
uint32_t chunks
 Outer chunks executed so far.
uint32_t last_boot_chunk
 Chunk of the last (re)boot.
uint32_t settle_left
 Post-click drain countdown.
uint32_t rec_frames
 –record frames written.
uint32_t prof_idle_run
 Consecutive profiler-idle chunks.
uint32_t idle_run
 Consecutive steady-idle chunks.
uint32_t usb_stop_run
 USB device settle countup.
uint32_t usbh_stop_run
 USB host settle countup.
uint64_t prof_idle_prev_i
 Prior total insns (profiler).
uint64_t idle_sig_prev
 Prior idle-signature sum.
uint64_t last_present_us
 wall-us of the last live present.
uint32_t prof_prev_pc
 PC charged by the wall profiler.
double prof_prev_t
 Start time of the prior chunk.
clock_t t0
 CPU-time origin for the guard.
uc_err err
 Latest uc_emu_start status.
bool prof_stopped
 Profiler stop fired.
bool idle_stopped
 Idle steady-state stop fired.
bool usb_stopped
 USB / banner early stop fired.
bool stop_sym_hit
 –stop-sym threshold reached.
bool timed_out
 Wall-clock guard fired.
bool closed
 Live window was closed.
bool button_fired
 Headless click button fired once.
bool slider_grab
 Battery slider grabbed by a drag.
board_overlay_btn_t held_btn
 SW held down (released on up).

Detailed Description

The whole run's mutable state, threaded through the phase helpers.

One bundle of the setup products (config, guards, presentation geometry + streamed surface, click classification) plus every loop counter mutates, so the loop body and the run-end finalizer become small phase helpers over st-> instead of one 500-line function over three dozen locals. Field semantics are unchanged from the pre-split locals.

Invariant
cfg and guards are fixed once ::run_loop_setup returns; the counter fields advance monotonically across the loop.
See also
run_loop_setup() The initializer.
run_loop() The consumer.
Since
0.1.0

Definition at line 50 of file emu_run_internal.h.

Field Documentation

◆ button_fired

bool run_loop_t::button_fired

Headless click button fired once.

Definition at line 87 of file emu_run_internal.h.

Referenced by internal_run_loop_click_tail(), and internal_run_loop_tick_inputs().

◆ cfg

◆ chunks

uint32_t run_loop_t::chunks

◆ click_btn

board_overlay_btn_t run_loop_t::click_btn

Classified –click target button.

Definition at line 62 of file emu_run_internal.h.

Referenced by internal_run_classify_click(), internal_run_loop_click_tail(), internal_run_loop_setup(), and internal_run_loop_tick_inputs().

◆ click_was_tab

bool run_loop_t::click_was_tab

–click landed on a console tab.

Definition at line 63 of file emu_run_internal.h.

Referenced by internal_run_classify_click(), and internal_run_loop_tick_inputs().

◆ closed

bool run_loop_t::closed

Live window was closed.

Definition at line 86 of file emu_run_internal.h.

Referenced by internal_run_loop_view(), and priv_run_hold_view().

◆ comp_h

uint16_t run_loop_t::comp_h

Composite (panel + sidebar) height.

Definition at line 58 of file emu_run_internal.h.

Referenced by internal_run_open_view(), internal_run_setup_geometry(), and priv_run_write_outputs().

◆ comp_w

uint16_t run_loop_t::comp_w

Composite (panel + sidebar) width.

Definition at line 57 of file emu_run_internal.h.

Referenced by internal_run_open_view(), internal_run_setup_geometry(), and priv_run_write_outputs().

◆ disp_h

uint16_t run_loop_t::disp_h

Displayed height (rotation-swapped).

Definition at line 56 of file emu_run_internal.h.

Referenced by internal_run_setup_geometry().

◆ disp_w

uint16_t run_loop_t::disp_w

Displayed width (rotation-swapped).

Definition at line 55 of file emu_run_internal.h.

Referenced by internal_run_classify_click(), internal_run_loop_tick_inputs(), internal_run_loop_view(), and internal_run_setup_geometry().

◆ err

uc_err run_loop_t::err

Latest uc_emu_start status.

Definition at line 80 of file emu_run_internal.h.

Referenced by internal_run_loop_run_chunk(), internal_run_loop_setup(), priv_run_cleanup(), and priv_run_report().

◆ guards

◆ held_btn

board_overlay_btn_t run_loop_t::held_btn

SW held down (released on up).

Definition at line 89 of file emu_run_internal.h.

Referenced by internal_run_loop_setup(), and internal_run_loop_view().

◆ idle_run

uint32_t run_loop_t::idle_run

Consecutive steady-idle chunks.

Definition at line 71 of file emu_run_internal.h.

Referenced by internal_run_stop_idle().

◆ idle_sig_prev

uint64_t run_loop_t::idle_sig_prev

Prior idle-signature sum.

Definition at line 75 of file emu_run_internal.h.

Referenced by internal_run_stop_idle().

◆ idle_stopped

bool run_loop_t::idle_stopped

Idle steady-state stop fired.

Definition at line 82 of file emu_run_internal.h.

Referenced by internal_run_stop_idle(), and priv_run_report().

◆ last_boot_chunk

uint32_t run_loop_t::last_boot_chunk

Chunk of the last (re)boot.

Definition at line 67 of file emu_run_internal.h.

Referenced by internal_run_loop_prologue().

◆ last_present_us

uint64_t run_loop_t::last_present_us

wall-us of the last live present.

Definition at line 76 of file emu_run_internal.h.

Referenced by internal_run_view_maybe_present().

◆ panel_h

uint16_t run_loop_t::panel_h

Firmware render height in pixels.

Definition at line 54 of file emu_run_internal.h.

Referenced by internal_run_loop_tick_inputs(), internal_run_loop_view(), and internal_run_setup_geometry().

◆ panel_w

uint16_t run_loop_t::panel_w

Firmware render width in pixels.

Definition at line 53 of file emu_run_internal.h.

Referenced by internal_run_loop_tick_inputs(), internal_run_loop_view(), and internal_run_setup_geometry().

◆ presentation

emu_presentation_workspace_t* run_loop_t::presentation

◆ prof_idle_prev_i

uint64_t run_loop_t::prof_idle_prev_i

Prior total insns (profiler).

Definition at line 74 of file emu_run_internal.h.

Referenced by internal_run_stop_prof_idle().

◆ prof_idle_run

uint32_t run_loop_t::prof_idle_run

Consecutive profiler-idle chunks.

Definition at line 70 of file emu_run_internal.h.

Referenced by internal_run_stop_prof_idle().

◆ prof_prev_pc

uint32_t run_loop_t::prof_prev_pc

PC charged by the wall profiler.

Definition at line 77 of file emu_run_internal.h.

Referenced by internal_run_loop_prologue().

◆ prof_prev_t

double run_loop_t::prof_prev_t

Start time of the prior chunk.

Definition at line 78 of file emu_run_internal.h.

Referenced by internal_run_loop_prologue().

◆ prof_stopped

bool run_loop_t::prof_stopped

Profiler stop fired.

Definition at line 81 of file emu_run_internal.h.

Referenced by internal_run_loop_run_chunk(), internal_run_stop_prof_idle(), and priv_run_report().

◆ reboot_count

int run_loop_t::reboot_count

–reboot warm reboots remaining.

Definition at line 64 of file emu_run_internal.h.

Referenced by internal_run_loop_prologue(), and internal_run_loop_setup().

◆ rec_frames

uint32_t run_loop_t::rec_frames

–record frames written.

Definition at line 69 of file emu_run_internal.h.

Referenced by internal_run_loop_record(), and priv_run_write_outputs().

◆ run_pc

uint32_t run_loop_t::run_pc

◆ settle_left

uint32_t run_loop_t::settle_left

Post-click drain countdown.

Definition at line 68 of file emu_run_internal.h.

Referenced by internal_run_loop_click_tail().

◆ slider_grab

bool run_loop_t::slider_grab

Battery slider grabbed by a drag.

Definition at line 88 of file emu_run_internal.h.

Referenced by internal_run_loop_view().

◆ stop_sym_hit

bool run_loop_t::stop_sym_hit

–stop-sym threshold reached.

Definition at line 84 of file emu_run_internal.h.

Referenced by internal_run_stop_sym(), and priv_run_report().

◆ t0

clock_t run_loop_t::t0

CPU-time origin for the guard.

Definition at line 79 of file emu_run_internal.h.

Referenced by internal_run_loop_click_tail(), internal_run_loop_setup(), and internal_run_stop_wall().

◆ timed_out

bool run_loop_t::timed_out

Wall-clock guard fired.

Definition at line 85 of file emu_run_internal.h.

Referenced by internal_run_loop_click_tail(), internal_run_stop_wall(), priv_run_cleanup(), and priv_run_report().

◆ usb_stop_run

uint32_t run_loop_t::usb_stop_run

USB device settle countup.

Definition at line 72 of file emu_run_internal.h.

Referenced by internal_run_stop_usb().

◆ usb_stopped

bool run_loop_t::usb_stopped

USB / banner early stop fired.

Definition at line 83 of file emu_run_internal.h.

Referenced by internal_run_stop_banner(), internal_run_stop_usb(), and priv_run_report().

◆ usbh_stop_run

uint32_t run_loop_t::usbh_stop_run

USB host settle countup.

Definition at line 73 of file emu_run_internal.h.

Referenced by internal_run_stop_usb().

◆ view

◆ view_storage

board_view_storage_t run_loop_t::view_storage

Caller-owned live-view handle storage.

Definition at line 60 of file emu_run_internal.h.

Referenced by internal_run_open_view().


The documentation for this struct was generated from the following file: