embassy-rs / stm32-data

75 stars 109 forks source link

[Tracker] PAC Cleanup #334

Closed eZioPan closed 9 months ago

eZioPan commented 10 months ago

* eZioPan is mopping the floor and humming


the regex I used to filter disable(d)/no(t)/un enum is

enum\/.*?\n *bit_size: 1\n *variants:\n *- name:.*?(dis|no|un(?!mask)).*?\n.*?\n *value: 0\n *- name:.*\n.*\n *value: 1\n

after all these PRs, there shouldn't left any "xxx disable(d) xxx" -> 0, "xxx enable(d) xxx" -> 1 enum in PAC.


I will try remove

Also I will gradually write down all my changes into chiptool transform file, including previously manually changed ones. So that if any new yaml is added, we can reuse the cleanup transform yaml to do a quick cleanup.


eZioPan commented 10 months ago

hi @Dirbaio , with all above PR merged, there is only one major peripheral waiting to clean: syscfg, more specific syscfg_f0 and syscfg_f3. There are a lot Not(Alternate)Remapped/Remapped, Standard/FMP enums, with a few NoSync/Sync, Disconnected/Connected, etc.

For Standard/FMP, we can merge them into one Standard/FMP enum, the field name should provide enough information.

For enums other than Standard/FMP and Not(Alternate)Remapped/Remapped, we can just replace them with false/true.

The most troublesome is Not(Alternate)Remapped/Remapped. In my opinion, the description of the enum value provides more information than value itself. So we can

And what makes these even worse, there are a few xxx_RMP fields in syscfg_f3, they got meaningful variant name, make all these even inconsistent.

Would you provide some suggestions?