D+ is PA12 not PA11. The reason this worked before, is because the line before made PA12 output, and without setting the GPIO_ODR register _before_ hand, this meant as soon as it was switched to output, it received the reset value of GPIO_ODR for PA12, ie, 0. (Effectively doing a "free" gpio_clear(GPIOA, GPIO12) Because GPIO11 wasn't configured to be an output, the confusing gpio_clear(GPIOA, GPIO11) was simply configuring the pullup/down value of the input, which was still ignored, as it was (out of reset) in input floating mode. Reviewed-by: Karl Palsson <karlp@tweak.net.au>
1.9 KiB
1.9 KiB