Skip to content

Commit 7eaf7e1

Browse files
authored
Merge pull request #604 from skoe/split_chips_to_chips_and_generator
Split chips to chips and generator, refactoring
2 parents ecd3617 + 5400dc5 commit 7eaf7e1

File tree

8 files changed

+711
-645
lines changed

8 files changed

+711
-645
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
"[cpp]": {
1313
"editor.formatOnSave": false
1414
},
15+
"editor.rulers": [
16+
120
17+
],
1518
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This project is built in three stages:
117117
6. Parse RCC registers for clock/reset settings (`src/rcc.rs`).
118118
7. Parse interrupts to map NVIC lines (`src/interrupts.rs`).
119119
8. Group all packages of a chip into `ChipGroup` structures (`src/chips.rs`).
120-
9. Use the parsed data to dump one JSON per MCU into `build/data/chips/*.json` (in `process_chip` of `src/chips.rs`).
120+
9. Use the parsed data to dump one JSON per MCU into `build/data/chips/*.json` (in `process_chip` of `src/generator.rs`).
121121

122122
3. **PAC Generation**
123123
- `stm32-metapac-gen` consumes the JSON files and generates the PAC crate:

stm32-data-gen/src/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn check(chip: &Chip) {
99
for ch in &core.dma_channels {
1010
let dma = peris.get(&ch.dma).unwrap();
1111
let signal = ch.name.strip_prefix(&format!("{}_", dma.name)).unwrap();
12-
if dma.interrupts.iter().find(|i| i.signal == signal).is_none() {
12+
if !dma.interrupts.iter().any(|i| i.signal == signal) {
1313
panic!("{}: missing irq for ch {}", chip.name, ch.name);
1414
}
1515
}

0 commit comments

Comments
 (0)