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