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

Output the missing peripheral name and referencing task instead of panicing. #151

Merged
merged 1 commit into from
May 11, 2021
Merged
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
12 changes: 10 additions & 2 deletions xtask/src/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,16 @@ fn make_descriptors(
// For peripherals referenced by the task, we don't need to allocate
// _new_ regions, since we did them all in advance. Just record the
// entries for the TaskDesc.
for (j, name) in task.uses.iter().enumerate() {
task_regions[allocs.len() + j] = peripheral_index[name] as u8;
for (j, peripheral_name) in task.uses.iter().enumerate() {
if let Some(&peripheral) = peripheral_index.get(&peripheral_name) {
task_regions[allocs.len() + j] = peripheral as u8;
} else {
bail!(
"Could not find peripheral `{}` referenced by task `{}`.",
peripheral_name,
name
);
}
}

let mut flags = abi::TaskFlags::empty();
Expand Down