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.
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
◆ 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
|
◆ limrun_restore()
Whether RESTORE is offered: the run is DONE and programmed, and ended as FAIL or ABORTED. servo_limrun_restore() wraps this.
- Parameters
-
| r | Run state. NULL gives false. |
- Returns
- true when the run is DONE, programmed, and ended as FAIL or ABORTED.
◆ limrun_span()
Distance from NEUTRAL to a side pulse limit, 0.1us, from the pulses given. servo_limrun_span() wraps this.
- Parameters
-
| sv | Servo pulses, 0.1us. |
| side | SERVO_LIMRUN_LO or SERVO_LIMRUN_HI. |
- Returns
- distance from NEUTRAL to the side pulse limit, 0.1us.
◆ span_now()
The span from the pulses in force: after SERVO PULSES at 1000-2000 those written, not those read.
- Parameters
-
| r | Run state holding pulse_now. |
| side | SERVO_LIMRUN_LO or SERVO_LIMRUN_HI. |
- Returns
- distance from NEUTRAL to the side pulse limit, 0.1us.