X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fstm32l.h;h=531a4fb9488c026e899ea48375bc4ca6c3048660;hb=6337b5f522be11926a6490d7bb27a4f7795da569;hp=50e5cc346a9ee0f404f06729a68ab6cc18f53182;hpb=a953ac32033ded18adf0cb3ca20134385fcd0a6d;p=fw%2Faltos diff --git a/src/stm/stm32l.h b/src/stm/stm32l.h index 50e5cc34..531a4fb9 100644 --- a/src/stm/stm32l.h +++ b/src/stm/stm32l.h @@ -133,6 +133,10 @@ stm_pupdr_get(struct stm_gpio *gpio, int pin) { static inline void stm_afr_set(struct stm_gpio *gpio, int pin, uint32_t value) { + /* + * Set alternate pin mode too + */ + stm_moder_set(gpio, pin, STM_MODER_ALTERNATE); if (pin < 8) gpio->afrl = ((gpio->afrl & ~(STM_AFR_MASK << STM_AFR_SHIFT(pin))) |