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

System-info and system-standby #43

Merged
merged 7 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/task/alarm_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,14 @@ impl<'a> PersistedAlarmSettings<'a> {
}
}

/// This function reads the alarm settings from the flash memory and sends it to the event channel.
///
/// It is done only once at the start of the program.
/// This task reads the alarm settings from the flash memory on startup and sends it to the event channel.
/// After that, it waits for commands to update the alarm settings.
#[embassy_executor::task]
pub async fn manage_alarm_settings(_spawner: Spawner, r: FlashResources) {
let mut persisted_alarm_settings = PersistedAlarmSettings::new(r);
let receiver = FLASH_CHANNEL.receiver();

{
'_read_alarm_settings: {
// Read the alarm settings from the flash memory only once at the start of the task
// and send them to the event channel. After that, we can drop this scope.
let alarm_settings = persisted_alarm_settings
Expand All @@ -140,7 +138,6 @@ pub async fn manage_alarm_settings(_spawner: Spawner, r: FlashResources) {
}

// and then we wait for commands to update the alarm settings
info!("Waiting for alarm settings commands");
loop {
let command = receiver.receive().await;
match command {
Expand Down
Loading
Loading