This patch, a slightly modified version of a patch from Thomas Otto,
should fix the following two issues:
- It generally sets the submited config to the mentioned GPIO pins but
kills configs for other pins on the same GPIO port. So if we want to set
PB6 and PB7 to push-pull and I2C2 SDA and SCL (PB10 and PB11) to open
drain it's simply impossible, because the second config try kills the first.
- The floating-bit thing isn't working correctly. If we enable a config
for PB6 for instance, the same config will also apply to all following
pins of that port (i.e. PB7-PB15). That's because the shifting isn't only
done if a pin isn't to configure, if you are hitting a matching bit the
shiftig is missing. I think shifting isn't nessessary for a separate
variable. We have the counting index from the for statement.
Both issues should now be fixed.
Thanks to Thomas Otto for pointing out problems with the clock code in
examples and his clock routine implementations. Based on that the most
common clock combination routines were added to the library and all
routines in examples setting up the clock replaced with calls to that
functions.
Now all examples are including only the modules they really need. Also
each header file of the library is including only the necessary headers
making it possible to use these modules in parallel with other
implementations that may collide with the definitions in other modules.
Thomas Otto has tested the code by successfully talking to a temperature
sensor from ST in master tranciever mode.
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
This model allows using libopenstm32 in parallel with other stm32
firmware libraries. It is not yet complete change to all code but a
start. Only changed parts that I tested.