Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
eilayk committed Mar 22, 2024
1 parent dc30853 commit 3e66750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions boards/recovery/src/data_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use defmt::info;
use heapless::HistoryBuffer;
use messages::sensor::{Air, EkfNav1, EkfNav2, EkfQuat, GpsVel, Imu1, Imu2, UtcTime};
use messages::Message;
use crate::app::recovery_timer_start;
use crate::app::recovery_counter_tick;

const MAIN_HEIGHT: f32 = 876.0; // meters ASL
const HEIGHT_MIN: f32 = 600.0; // meters ASL
Expand Down Expand Up @@ -83,7 +83,7 @@ impl DataManager {
None => false,
}
}
pub fn is_landed(&self) -> bool {
pub fn is_landed(&mut self) -> bool {
if self.historical_barometer_altitude.len() < 8 {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions boards/recovery/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ mod app {
// handle recovery counter
// start a counter
#[task(local = [recovery_timer])]
fn recovery_counter_tick(mut cx: recovery_timer_start::Context) {
fn recovery_counter_tick(mut cx: recovery_counter_tick::Context) {

Check warning on line 150 in boards/recovery/src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable --> boards/recovery/src/main.rs:150:30 | 150 | fn recovery_counter_tick(mut cx: recovery_counter_tick::Context) { | ----^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
let timer = cx.local.recovery_timer;
// should probably check if timer is already running
// to avoid resetting it

let duration_mins = atsamd_hal::fugit::MinutesDurationU32::minutes(1);
// timer requires specific duration format
let timer_duration: atsamd_hal::fugit::Duration<u32, 1, 1000000000> = duration_mins.convert();
timer.start();
timer.start(timer_duration);
}

// interrupt handler for when counter is finished
#[task(binds=TC2, local = [recovery_timer], shared=[data_manager])]
#[task(binds=TC2, shared=[data_manager])]
fn recovery_counter_finish(mut cx: recovery_counter_finish::Context) {
cx.shared.data_manager.lock(|data| {
data.recovery_counter += 1;
Expand Down

0 comments on commit 3e66750

Please sign in to comment.