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

What servo_limrun.c and servo_limrun_report.c share and nothing else reads: where a side stands, a side's span, and whether RESTORE is offered. The two predicates are inline here so that the report, in its own file, inlines them; the public servo_limrun_span() and servo_limrun_restore() wrap them. More...

#include "servo_limrun.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

Go to the source code of this file.

Enumerations

enum  limrun_stage_t {
  ST_NONE = 0 , ST_OVERSET , ST_OVERSET_SEARCH , ST_FINAL ,
  ST_DONE
}
 Where a side stands. More...

Functions

static int32_t limrun_span (const servo_limrun_servo_t *sv, uint8_t side)
 Distance from NEUTRAL to a side pulse limit, 0.1us, from the pulses given. servo_limrun_span() wraps this.
static bool limrun_restore (const servo_limrun_t *r)
 Whether RESTORE is offered: the run is DONE and programmed, and ended as FAIL or ABORTED. servo_limrun_restore() wraps this.
static int32_t span_now (const servo_limrun_t *r, uint8_t side)
 The span from the pulses in force: after SERVO PULSES at 1000-2000 those written, not those read.

Detailed Description

What servo_limrun.c and servo_limrun_report.c share and nothing else reads: where a side stands, a side's span, and whether RESTORE is offered. The two predicates are inline here so that the report, in its own file, inlines them; the public servo_limrun_span() and servo_limrun_restore() wrap them.

SPDX-License-Identifier: MIT

Enumeration Type Documentation

◆ limrun_stage_t

Where a side stands.

Enumerator
ST_NONE 

not bound in the first search: nothing to write

ST_OVERSET 

the overset is to be written

ST_OVERSET_SEARCH 

written; the side's search follows

ST_FINAL 

the final value is to be written

ST_DONE 

the final value is written

Function Documentation

◆ limrun_restore()

bool limrun_restore ( const servo_limrun_t * r)
inlinestatic

Whether RESTORE is offered: the run is DONE and programmed, and ended as FAIL or ABORTED. servo_limrun_restore() wraps this.

Parameters
rRun state. NULL gives false.
Returns
true when the run is DONE, programmed, and ended as FAIL or ABORTED.

◆ limrun_span()

int32_t limrun_span ( const servo_limrun_servo_t * sv,
uint8_t side )
inlinestatic

Distance from NEUTRAL to a side pulse limit, 0.1us, from the pulses given. servo_limrun_span() wraps this.

Parameters
svServo pulses, 0.1us.
sideSERVO_LIMRUN_LO or SERVO_LIMRUN_HI.
Returns
distance from NEUTRAL to the side pulse limit, 0.1us.

◆ span_now()

int32_t span_now ( const servo_limrun_t * r,
uint8_t side )
inlinestatic

The span from the pulses in force: after SERVO PULSES at 1000-2000 those written, not those read.

Parameters
rRun state holding pulse_now.
sideSERVO_LIMRUN_LO or SERVO_LIMRUN_HI.
Returns
distance from NEUTRAL to the side pulse limit, 0.1us.