From b2f455b2cf65bf9eac45deba7f91638ea68984cc Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 13 Dec 2020 02:33:59 +0100 Subject: [PATCH] config: save/store pid_engaged Fixes Gitea issue #17 --- src/config.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config.rs b/src/config.rs index a1ca7ee..71db656 100644 --- a/src/config.rs +++ b/src/config.rs @@ -17,6 +17,7 @@ pub struct ChannelConfig { center: CenterPoint, pid: pid::Parameters, pid_target: f32, + pid_engaged: bool, sh: steinhart_hart::Parameters, pwm: PwmLimits, /// uses variant `PostFilter::Invalid` instead of `None` to save space @@ -36,6 +37,7 @@ impl ChannelConfig { center: state.center.clone(), pid: state.pid.parameters.clone(), pid_target: state.pid.target as f32, + pid_engaged: state.pid_engaged, sh: state.sh.clone(), pwm, adc_postfilter, @@ -47,6 +49,7 @@ impl ChannelConfig { state.center = self.center.clone(); state.pid.parameters = self.pid.clone(); state.pid.target = self.pid_target.into(); + state.pid_engaged = self.pid_engaged; state.sh = self.sh.clone(); self.pwm.apply(channels, channel);