|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Host-side keystroke FIFO: window / CLI key source -> UART RX sink. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| void | board_input_push_key (char ch) |
| Push one keystroke byte into the input FIFO. | |
| bool | board_input_pop_key (char *out) |
| Pop the oldest buffered keystroke, if any. | |
Host-side keystroke FIFO: window / CLI key source -> UART RX sink.
A tiny plain-C ring buffer that decouples the keystroke SOURCE from the SINK so the interactive keyboard input is deterministically testable. The source is either the live --view window (its Cocoa keyDown handler pushes each typed character) or the headless --keys flag (which pushes a scripted string); the sink is the run loop, which drains the FIFO every chunk into the console UART RX – the same SCI channel --input targets. Keeping the FIFO here in plain C (not inside the Objective-C view) lets --keys exercise the exact push -> drain -> SCI path on any host with no window and no OS key events, so the keyboard path is verifiable headlessly and in CI – not only by typing into a window. Single-threaded harness use; not thread-safe.
Definition in file board_input.h.
| bool board_input_pop_key | ( | char * | out | ) |
Pop the oldest buffered keystroke, if any.
| [out] | out | Receives one keystroke byte when true is returned. |
out is NULL. Pop the oldest buffered keystroke, if any; this step is contained within the board input model and uses bounded caller or module-owned storage.
| true | The board input pop key condition holds or completed successfully; false otherwise. |
Definition at line 37 of file board_input.c.
References k_key_ring_cap, s_head, s_ring, and s_tail.
Referenced by internal_run_loop_tick_inputs().
| void board_input_push_key | ( | char | ch | ) |
Push one keystroke byte into the input FIFO.
Appends ch to the ring; on overflow the newest key is dropped (the firmware draining the FIFO is the slow consumer). Called by the window keyDown handler and by the --keys injector alike, so both reach the UART through one path.
| [in] | ch | Keystroke byte to enqueue. |
Definition at line 28 of file board_input.c.
References k_key_ring_cap, s_head, s_ring, and s_tail.
Referenced by internal_main_feed_inputs().