Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create recovery timer mechanism #101

Merged
merged 12 commits into from
Jun 8, 2024
Merged

create recovery timer mechanism #101

merged 12 commits into from
Jun 8, 2024

Conversation

eilayk
Copy link
Contributor

@eilayk eilayk commented Mar 22, 2024

No description provided.

@eilayk eilayk requested a review from NoahSprenger March 22, 2024 22:22
boards/recovery/src/data_manager.rs Outdated Show resolved Hide resolved
boards/recovery/src/data_manager.rs Show resolved Hide resolved
boards/recovery/src/data_manager.rs Outdated Show resolved Hide resolved
boards/recovery/src/main.rs Outdated Show resolved Hide resolved
boards/recovery/src/main.rs Show resolved Hide resolved
boards/recovery/src/main.rs Outdated Show resolved Hide resolved
boards/recovery/src/main.rs Outdated Show resolved Hide resolved
let timerclk: hal::clock::v1::Tc2Tc3Clock = pclk_tc2tc3.into();
let mut recovery_timer =
hal::timer::TimerCounter2::tc2_(&timerclk, peripherals.TC2, &mut mclk);
recovery_timer.enable_interrupt();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to enable interrupts here, just create the timer object.

data.recovery_counter += 1;
});
}
// restart timer after interrupt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic should be inside the if statement, not outside of it. This is because the timer interrupt can fire for multiple reasons and right now you are restarting the time for any and all interrupts, not just the case that it is finished.

@@ -8,6 +8,7 @@ use messages::command::{Command, PowerDown, RadioRate, RadioRateChange};
use messages::sender::Sender::SensorBoard;
use messages::Message;
use rtic::mutex::Mutex;
use atsamd_hal::prelude::_atsamd_hal_timer_traits_InterruptDrivenTimer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this was needed? What is the error if you do not include this?

Copy link
Contributor

@NoahSprenger NoahSprenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments 👍

@NoahSprenger NoahSprenger merged commit 0251afa into master Jun 8, 2024
5 checks passed
@NoahSprenger NoahSprenger deleted the wait-for-recovery branch June 8, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants