Simplifying settings lock
This commit is contained in:
parent
7b76b1f14c
commit
d68fa87fec
|
@ -193,19 +193,16 @@ const APP: () = {
|
|||
let telemetry: TelemetryBuffer =
|
||||
c.resources.telemetry.lock(|telemetry| *telemetry);
|
||||
|
||||
let gains: [AfeGain; 2] =
|
||||
c.resources.settings.lock(|settings| settings.afe);
|
||||
let (gains, telemetry_period) = c
|
||||
.resources
|
||||
.settings
|
||||
.lock(|settings| (settings.afe, settings.telemetry_period));
|
||||
|
||||
c.resources
|
||||
.network
|
||||
.telemetry
|
||||
.publish(&telemetry.finalize(gains[0], gains[1]));
|
||||
|
||||
let telemetry_period = c
|
||||
.resources
|
||||
.settings
|
||||
.lock(|settings| settings.telemetry_period);
|
||||
|
||||
// Schedule the telemetry task in the future.
|
||||
c.schedule
|
||||
.telemetry(
|
||||
|
|
|
@ -275,19 +275,16 @@ const APP: () = {
|
|||
c.resources.digital_inputs.1.is_high().unwrap(),
|
||||
];
|
||||
|
||||
let gains: [AfeGain; 2] =
|
||||
c.resources.settings.lock(|settings| settings.afe);
|
||||
let (gains, telemetry_period) = c
|
||||
.resources
|
||||
.settings
|
||||
.lock(|settings| (settings.afe, settings.telemetry_period));
|
||||
|
||||
c.resources
|
||||
.network
|
||||
.telemetry
|
||||
.publish(&telemetry.finalize(gains[0], gains[1]));
|
||||
|
||||
let telemetry_period = c
|
||||
.resources
|
||||
.settings
|
||||
.lock(|settings| settings.telemetry_period);
|
||||
|
||||
// Schedule the telemetry task in the future.
|
||||
c.schedule
|
||||
.telemetry(
|
||||
|
|
Loading…
Reference in New Issue