1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! `INIT` — "is the next conversion the initial one?" — for the analog records.
//!
//! C keeps this as `prec->init`, a `DBF_SHORT` served read-only (`SPC_NOMOD`)
//! on `ai` and `ao`. Its lifecycle is identical in both:
//!
//! * `init_record` sets it TRUE (`aiRecord.c:114`, `aoRecord.c:120`);
//! * `process` clears it FALSE on the way out (`aiRecord.c:170`,
//! `aoRecord.c:237`) — every process, not just the first;
//! * an `SPC_LINCONV` special (a put to `LINR` / `EGUF` / `EGUL`) sets it TRUE
//! again (`aiRecord.c:187`, `aoRecord.c:254`).
//!
//! While TRUE it means the next conversion has no history to build on:
//! `cvtRawToEngBpt` re-resolves the breakpoint table instead of reusing the
//! cached interval, and `ai`'s SMOO filter takes `prec->val = val` as its
//! initial condition rather than smoothing against a stale VAL.
//!
//! It is a phase, not a "primed" bit, and the two readings have opposite
//! polarity — which is how the port came to serve `INIT = 0` on a freshly
//! initialised `ai` where C serves 1 (measured: `record(ai,"P:AI"){}` on the
//! compiled softIoc, `caget -t P:AI.INIT` -> `1`). Naming the two states
//! removes the polarity from the call sites: there is no `init = false` to read
//! backwards, only `ConvertPhase::Initial` and `ConvertPhase::Converted`.
use crateEpicsValue;
/// C `prec->init` on `ai`/`ao`, as a named phase rather than a bare flag.