Simplifying settings lock

This commit is contained in:
Ryan Summers 2021-05-07 13:04:25 +02:00
parent 7b76b1f14c
commit d68fa87fec
2 changed files with 8 additions and 14 deletions

View File

@ -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(

View File

@ -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(