Skip to content
Snippets Groups Projects
Commit d0dfbf00 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

cpu: stm32f3: periph: gpio: fix possibly uninitialized variable access

parent 8653e685
Branches
No related tags found
No related merge requests found
......@@ -126,6 +126,8 @@ int gpio_init_out(gpio_t dev, gpio_pp_t pushpull)
pin = GPIO_11_PIN;
break;
#endif
default:
return -1;
}
port->MODER &= ~(2 << (2 * pin)); /* set pin to output mode */
......@@ -229,6 +231,8 @@ int gpio_init_in(gpio_t dev, gpio_pp_t pushpull)
pin = GPIO_11_PIN;
break;
#endif
default:
return -1;
}
port->MODER &= ~(3 << (2 * pin)); /* configure pin as input */
......@@ -597,6 +601,8 @@ int gpio_read(gpio_t dev)
pin = GPIO_11_PIN;
break;
#endif
default:
return -1;
}
if (port->MODER & (3 << (pin * 2))) { /* if configured as output */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment