Skip to content

Commit

Permalink
Fix: remove magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSprenger committed Jun 8, 2024
1 parent 521408b commit 3544a46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boards/recovery/src/data_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const MAIN_HEIGHT: f32 = 876.0; // meters ASL
const HEIGHT_MIN: f32 = 600.0; // meters ASL
const RECOVERY_DATA_POINTS: u8 = 8; // number of barometric altitude readings held by the recovery
// algorithm
const RECOVERY_TIMER_TIMEOUT: u8 = 15; // minutes

pub struct DataManager {
pub air: Option<Air>,
Expand Down Expand Up @@ -104,7 +105,7 @@ impl DataManager {
match avg_sum / 7.0 {
// inclusive range
x if (-0.25..=0.25).contains(&x) => {
if self.recovery_counter >= 15 {
if self.recovery_counter >= RECOVERY_TIMER_TIMEOUT {
return true;
}
}
Expand Down

0 comments on commit 3544a46

Please sign in to comment.