Skip to content

added ignite task - #84

Open
Bartosz-Slowik wants to merge 2 commits into
mainfrom
Bartosz-ignition
Open

added ignite task#84
Bartosz-Slowik wants to merge 2 commits into
mainfrom
Bartosz-ignition

Conversation

@Bartosz-Slowik

Copy link
Copy Markdown
Collaborator

Added 3 pins as ignition pins
You can use ignite task to set them high for 1 second

Comment on lines +163 to +184
pub async fn ignite(ctx: app::ignite::Context<'_>, stage: u8) {
//this delay is for testing purposes
Systick::delay(1.secs()).await;
match stage {
1 => ctx.local.ignite_pins.pb0.set_low(),
2 => ctx.local.ignite_pins.pb1.set_low(),
3 => ctx.local.ignite_pins.pb2.set_low(),
_ => {
defmt::error!("Invalid stage when igniting");
return;
}
}
Systick::delay(1.secs()).await;
match stage {
1 => ctx.local.ignite_pins.pb0.set_high(),
2 => ctx.local.ignite_pins.pb1.set_high(),
3 => ctx.local.ignite_pins.pb2.set_high(),
_ => {
defmt::error!("Invalid stage when deigniting");
}
}
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If anyone know how to write it without code repetition, but still readable please let me know

@Bartosz-Slowik
Bartosz-Slowik marked this pull request as ready for review August 27, 2023 01:37
@Bartosz-Slowik Bartosz-Slowik self-assigned this Aug 27, 2023
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.

1 participant