Skip to content

Commit e566814

Browse files
author
Jorge Aparicio
committed
add interrupt number to the interrupts' documentation
1 parent 4a84507 commit e566814

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/generate.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
4646
.map(|i| (i.value, i))
4747
.collect::<HashMap<_, _>>();
4848

49-
let mut interrupts = interrupts.into_iter().map(|(_, v)| v).collect::<Vec<_>>();
49+
let mut interrupts =
50+
interrupts.into_iter().map(|(_, v)| v).collect::<Vec<_>>();
5051
interrupts.sort_by_key(|i| i.value);
5152

5253
let mut fields = vec![];
@@ -84,10 +85,13 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
8485

8586
let name = Ident::new(&*interrupt.name.to_sanitized_snake_case());
8687
let name_pc = Ident::new(interrupt.name.to_sanitized_pascal_case());
87-
let description = interrupt.description
88-
.as_ref()
89-
.map(|s| util::respace(s))
90-
.unwrap_or_else(|| interrupt.name.clone());
88+
let description =
89+
format!("{} - {}",
90+
interrupt.value,
91+
interrupt.description
92+
.as_ref()
93+
.map(|s| util::respace(s))
94+
.unwrap_or_else(|| interrupt.name.clone()));
9195
fields.push(quote! {
9296
#[doc = #description]
9397
pub #name: extern "C" fn(#name_pc),

0 commit comments

Comments
 (0)