Skip to content

Commit 02bcb24

Browse files
committed
fix infinite loop
1 parent 3d784c9 commit 02bcb24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/generate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
123123
for interrupt in &interrupts {
124124
while pos < interrupt.value {
125125
elements.push(quote!(None));
126+
pos += 1;
126127
}
128+
pos += 1;
127129

128130
let name_uc = Ident::new(interrupt.name.to_sanitized_upper_case());
129131
let description = format!(
@@ -153,7 +155,6 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
153155

154156
elements.push(quote!(Some(#name_uc)));
155157
names.push(name_uc);
156-
pos = interrupt.value + 1;
157158
}
158159

159160
let n = util::unsuffixed(u64(pos));

0 commit comments

Comments
 (0)