Fix GPIO alternate function definition
A change of the mode of a GPIO to Mode::ALTERNATE before setting the alternate function number could cause a glitch where the GPIO is initialized with an undefined alternate function before changing it to the wanted one. This error can be found in a lot of bsp.cpp files and in drivers that change the mode of the pin (e.g. I2C).
TL;DR: This is an error:
pin.mode(Mode::ALTERNATE);
pin.alternateFunction(<alternateFunctionNumber>);
This is right:
pin.alternateFunction(<alternateFunctionNumber>);
pin.mode(Mode::ALTERNATE);