tests: gadget0: stm32f1 hack should be consistent

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>
This commit is contained in:
Amitesh Singh 2017-08-26 19:40:55 +09:00 committed by Karl Palsson
parent b0e050d10d
commit 821f4a49ea

View File

@ -50,7 +50,7 @@ int main(void)
*/ */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ, gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO12); GPIO_CNF_OUTPUT_PUSHPULL, GPIO12);
gpio_clear(GPIOA, GPIO11); gpio_clear(GPIOA, GPIO12);
for (unsigned int i = 0; i < 800000; i++) { for (unsigned int i = 0; i < 800000; i++) {
__asm__("nop"); __asm__("nop");
} }