Disallow automatic startup
If the start/stop switch is set before air pressure is present, do not automatically start the process. To start from such a situation, the start/stop switch first needs to be turned off, then turned on again.
This commit is contained in:
parent
b53b37845d
commit
fa2d012fd3
1 changed files with 5 additions and 1 deletions
|
|
@ -41,13 +41,17 @@ pi::process_image! {
|
||||||
pub running: (X, 200, 0),
|
pub running: (X, 200, 0),
|
||||||
pub faulted: (X, 200, 1),
|
pub faulted: (X, 200, 1),
|
||||||
pub state: (X, 200, 2),
|
pub state: (X, 200, 2),
|
||||||
|
pub pressure_ok: (X, 200, 3),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn program(inp: Pii, mut out: PiqMut, now: profirust::time::Instant) {
|
fn program(inp: Pii, mut out: PiqMut, now: profirust::time::Instant) {
|
||||||
let now = u64::try_from(now.total_millis()).unwrap();
|
let now = u64::try_from(now.total_millis()).unwrap();
|
||||||
|
|
||||||
let running = inp.want_run() && (*out.running() || inp.bpb1());
|
let pressure_ok = inp.bpb1() && (*out.pressure_ok() || !inp.want_run());
|
||||||
|
*out.pressure_ok() = pressure_ok;
|
||||||
|
|
||||||
|
let running = inp.want_run() && (*out.running() || *out.pressure_ok());
|
||||||
let mut faulted = *out.faulted() && running;
|
let mut faulted = *out.faulted() && running;
|
||||||
*out.pza1_orange() = faulted;
|
*out.pza1_orange() = faulted;
|
||||||
*out.pza1_blue() = !running && !faulted;
|
*out.pza1_blue() = !running && !faulted;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue