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

added ignite task #84

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

added ignite task #84

wants to merge 2 commits into from

Conversation

Bartosz-Slowik
Copy link
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
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