So,

As you see most of the file is actually the same.

Even the STM32F050 and the STM32F051 files share a lot of common lines.
(check the files with meld or something similar which shows much better
than diff how much of the file is similar).

Currently, the algorithm only works on an entire GPIO, so even small differences in AF are seen as a completely different GPIO.
Having a "second layer" of differences within one GPIO, will require some changes to the way the generator stores the differences.

It might be interesting to create a generic solution for this problem, but for now it is simpler to merge this by hand.
The DFG is supposed to be a starting point for further manual optimisation, not a finished solution.

Scratch that, after a good night’s sleep and a brainwave in the morning, differences in AF can now be automatically described as well.
The solution required placing the GPIOs and AFs into two separate flat lists and then bringing them together while writing, using existing code for generating the device id filters.

See this commit.

Now excuse me while I bask in the adulation of my numerous companions.*

Cheers.
Niklas

*: I may have been watching Rango…