|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
splash_screen.h says what this screen is for. More...
#include "splash_screen.h"#include <stdio.h>#include <string.h>#include "ui_text.h"#include "ui_theme.h"#include "ui_widgets.h"Data Structures | |
| struct | [struct].s |
| Driver state of the UART: the claimed machines and the pins. More... | |
Macros | |
| #define | W UI_PANEL_W |
| The panel's width, px. | |
| #define | H UI_PANEL_H |
| The panel's height, px. | |
| #define | HOLD_S 1.6f |
| The hold after the last step has answered, s. | |
| #define | SP_FONT_MARK (&gfx_font_20x36) |
| The mark's face, drawn at MARK_SCALE: 20 x 36. | |
| #define | SP_FONT_BODY UI_FONT_BODY |
| The tagline and the steps: 12 x 24. | |
| #define | SP_FONT_LABEL (&gfx_font_10x20) |
| The credit: 10 x 20. | |
| #define | MARK_SCALE 2 |
| The mark's scale: twice the home tag. | |
| #define | MARK_Y 40 |
| The mark's top. | |
| #define | MARK_H (MARK_SCALE * UI_TAG_H) |
| #define | MARK_PAD (MARK_SCALE * 12) |
| #define | MARK_CHAMFER (MARK_SCALE * UI_CHAMFER) |
| The mark's chamfer, px. | |
| #define | TAGLINE_Y (MARK_Y + MARK_H + 20) |
| The tagline's top. | |
| #define | ROW_H 40 |
| A step's row, px. | |
| #define | LIST_Y 200 |
| The first step's top. | |
| #define | LIST_X 192 |
| The steps' names' left edge. | |
| #define | MARK_X (LIST_X + 180) |
| #define | DETAIL_X (LIST_X + 240) |
| A step's detail's left edge. | |
| #define | DETAIL_W (W - 24 - DETAIL_X) |
| A step's detail's width: 47 cells of SP_FONT_BODY. | |
| #define | CREDIT_Y (H - 36) |
| The credit's top. | |
Functions | |
| void | splash_invalidate (void) |
| Draw the whole splash again on both framebuffers. | |
| static void | reset (void) |
| Every step pending, nothing held. | |
| void | splash_screen_set (splash_step_t step, splash_result_t result, const char *detail) |
| A step's result and its detail. | |
| static bool | all_answered (void) |
| Whether every step has answered. | |
| bool | splash_screen_done (void) |
| Whether the splash may hand over. | |
| static void | tick (float dt_s) |
| Time passed: the hold runs once every step has answered. | |
| static void | event (const touch_event_t *evt) |
| A touch: a tap skips the hold. | |
| static gfx_color_t | colour_of (splash_result_t r) |
| A result's colour. | |
| static const char * | mark_of (splash_result_t r) |
| A result's mark. | |
| static void | draw_mark (gfx_canvas_t *c, const char *text, gfx_color_t fill) |
The mark: the home tag's chamfered shape at MARK_SCALE times its size, centred, with text on it. | |
| static void | render (gfx_canvas_t *c, int buffer_index) |
| The splash: the mark, the tagline and the credit once per framebuffer, the steps' rows every frame. | |
| const ui_screen_t * | splash_screen (void) |
| The splash. | |
Variables | |
| static const ui_text_id_t | k_labels [SPLASH_STEP_COUNT] |
| Each step's name, in the order of splash_step_t. | |
| static struct | s |
| static const ui_screen_t | k_screen |
| The splash, as the router takes it. | |
splash_screen.h says what this screen is for.
SPDX-License-Identifier: MIT
| #define MARK_H (MARK_SCALE * UI_TAG_H) |
88px
| #define MARK_PAD (MARK_SCALE * 12) |
text to either edge
| #define MARK_X (LIST_X + 180) |
a step's OK, –, !!
|
static |
Whether every step has answered.
|
static |
A result's colour.
| r | The result. |
|
static |
The mark: the home tag's chamfered shape at MARK_SCALE times its size, centred, with text on it.
| c | Canvas, the whole panel. |
| text | The word. |
| fill | The shape's colour. |
|
static |
A touch: a tap skips the hold.
| evt | The event. |
|
static |
A result's mark.
| r | The result. |
|
static |
The splash: the mark, the tagline and the credit once per framebuffer, the steps' rows every frame.
| c | Canvas, the whole panel. |
| buffer_index | The framebuffer drawn into. |
| const ui_screen_t * splash_screen | ( | void | ) |
The splash.
| bool splash_screen_done | ( | void | ) |
Whether the splash may hand over.
| void splash_screen_set | ( | splash_step_t | step, |
| splash_result_t | result, | ||
| const char * | detail ) |
A step's result and its detail.
| step | The step. |
| result | Its result. |
| detail | What it found, or NULL for nothing. |
|
static |
Time passed: the hold runs once every step has answered.
| dt_s | The time since the last tick, in seconds. |
|
static |
Each step's name, in the order of splash_step_t.
|
static |
The splash, as the router takes it.
| struct [struct].s s |
the steps and the hold