embassy-rs / chiptool

Apache License 2.0
37 stars 21 forks source link

resolve derived enums #11

Closed oll3 closed 10 months ago

oll3 commented 10 months ago

I tried to generate ADC yaml's for stm32wle5 but it failed when chiptool wasn't able to follow the derivedFrom directive used in the svd.

This PR tries to resolve the derivedFrom by initially creating a map of all enums. And upon reaching a derivedFrom picking the enum values from that map, if known.

Note that it ignores if there are enums which are not unique by name in the config, though looking at stm32-rs scripts I got the impression that they ignored this too.