rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
motor_events.c File Reference

The MOTOR & ESC screen's events: a touch on the strip, the rail, LIVE's page and the pages of the other tasks, and the frame's tick. motor_screen.c holds the state, the commands and the screen's interface (motor_screen.h); motor_live_int.h is what it shares with this file and motor_draw.c. More...

#include <stdint.h>
#include <string.h>
#include "motor_screen.h"
#include "settings.h"
#include "ui_slider.h"
#include "ui_tabs.h"
#include "ui_value_gate.h"
#include "prog_registry.h"
#include "outputs_screen.h"
#include "port_view.h"
#include "ui_widgets.h"
#include "motor_live_int.h"

Functions

static void task_changed (void)
 Another task is shown. A press on the page that went goes with it: a drag on the throttle, a step button, PLOT or TABLE half pressed, a value on SETTINGS. ARM is on the rail, which stays, and keeps its press. The page is repainted whole.
static void session_opened (void)
 A session opened over the body: the presses the screen held go, as at a change of task – a hold of ARM, a throttle drag, a step button, a tab – and the session's first frame is painted whole. ARM and the throttle are out of sight under it, so a bench that is not SAFE switches to SAFE first: a DISARM held by another finger, whose release the session takes, is posted here, and no output drives under a session that hides DISARM.
static void open_outputs (void)
 The TARGET row tapped: OUTPUTS, where the throttle's pins are bound, on the protocol they are bound as; on the PROG PORT entry of a DShot programming port the throttle drives alone; on the overview while they are bound as several or none is known. The router leaves this screen for it, which switches the bench to SAFE as any way out does (leave()); the row takes the tap only on a SAFE bench. The home tag there comes back here (ui_router_parent()), on the task the row was tapped on.
bool mo_safe_at (int x, int y)
 Returns whether a DOWN at (x, y) is on a control whose press stops what the bench drives: a session's ABORT, or DISARM while the button reads DISARM.
void mo_event (const touch_event_t *evt)
 Takes a touch event.
void mo_tick (float dt_s)
 Advances the screen by one frame: the ARM hold and flash animations, the knob and the polled state.

Detailed Description

The MOTOR & ESC screen's events: a touch on the strip, the rail, LIVE's page and the pages of the other tasks, and the frame's tick. motor_screen.c holds the state, the commands and the screen's interface (motor_screen.h); motor_live_int.h is what it shares with this file and motor_draw.c.

SPDX-License-Identifier: MIT

Function Documentation

◆ mo_event()

void mo_event ( const touch_event_t * evt)

Takes a touch event.

Parameters
evtthe event

◆ mo_safe_at()

bool mo_safe_at ( int x,
int y )

Returns whether a DOWN at (x, y) is on a control whose press stops what the bench drives: a session's ABORT, or DISARM while the button reads DISARM.

Parameters
xcolumn, px
yrow, px
Returns
true when the point is on such a control

◆ mo_tick()

void mo_tick ( float dt_s)

Advances the screen by one frame: the ARM hold and flash animations, the knob and the polled state.

Parameters
dt_stime since the last tick, s