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

The bench's arm on the control task: the state the loop starts from, the watch on an arm until the render side has seen it, the run's totals, the latched stop and the act the arming policy asks for, the OUTPUTS screen's binding onto the IOmcu's output pages, disarming wherever it was asked for, one motor command, and the screens' commands in their order. More...

#include <stdatomic.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "arming.h"
#include "bench_state.h"
#include "bind_link.h"
#include "heartbeat.h"
#include "hitec_link.h"
#include "kst_link.h"
#include "link_host.h"
#include "link_pages.h"
#include "motor_screen.h"
#include "out_bind.h"
#include "outputs.h"
#include "outputs_pages.h"
#include "outputs_screen.h"
#include "panel.h"
#include "prog_link.h"
#include "sense_link.h"
#include "servo_link.h"
#include "servo_source.h"
#include "supply.h"
#include "supply_link.h"
#include "telemetry_sim.h"
#include "tone_link.h"
#include "touch_loss.h"
#include "ui_text.h"

Macros

#define DISARM_INHIBIT_MS   (2u * HEARTBEAT_MAX_GAP_MS)

Functions

static uint16_t pct_to_span (float pct)
static uint16_t pct_to_hundredths (float pct)
void control_setup (telemetry_sim_t *sim, bench_state_t *bench)
static void arm_applied (void)
 An arm was applied: number it, and watch it until the render side has seen it. The snapshot carries the number; the render side acknowledges it at the end of a frame that began with the bench armed and found no loss.
void arm_watch_service (bool link_up)
static void service_disarm (bool link_up)
void service_arming (bool link_up)
 The latched stop and the act the arming policy asks for, once a pass of the control task: the router's backstop STOP unless the pump counted the same press, the let-go every stop owes, the supply, then the arm or the disarm.
static bool write_output_binding (const outbind_t *bind)
bool disarm_here (bool link_up)
static void apply_motor_cmd (const motor_cmd_t *mc, bool link_up, bench_state_t *bench)
void drain_commands (bool link_up, bench_state_t *bench)

Variables

static uint32_t s_stops_served
static bool s_disarm_timing
static uint32_t s_disarm_since
bench_totals_t s_totals
uint32_t s_totals_ms
log_rail_t s_rail
 The supply's last reading for a SERVO run's rows (log_rail_t). Control task only.
bench_totals_t s_rail_totals
 The run's totals of s_rail since the arm. Control task only.

Detailed Description

The bench's arm on the control task: the state the loop starts from, the watch on an arm until the render side has seen it, the run's totals, the latched stop and the act the arming policy asks for, the OUTPUTS screen's binding onto the IOmcu's output pages, disarming wherever it was asked for, one motor command, and the screens' commands in their order.

SPDX-License-Identifier: MIT

Function Documentation

◆ service_arming()

void service_arming ( bool link_up)

The latched stop and the act the arming policy asks for, once a pass of the control task: the router's backstop STOP unless the pump counted the same press, the let-go every stop owes, the supply, then the arm or the disarm.

Parameters
link_upwhether the link to the IOmcu answers

Variable Documentation

◆ s_disarm_timing

bool s_disarm_timing
static

whether s_disarm_since means anything