summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-28 02:05:22 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-28 02:05:22 +0100
commit9d41bed3f5c923de4aae10a27f05652b308459dd (patch)
tree2539b7b6ffb7048dada59d55591d9f3d583dd788
parent4ab64988e360db004942acb811559ee78e5ea9ff (diff)
gpio: initialize led at setup onlyolimex-stm32-h407
-rw-r--r--src/gpio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gpio.c b/src/gpio.c
index 2c00fe8..3df39cb 100644
--- a/src/gpio.c
+++ b/src/gpio.c
@@ -87,8 +87,6 @@ gpio_set_output(volatile struct gpio_regs *regs, unsigned int io, bool high)
{
uint32_t shift, mask;
- gpio_set_af(gpio_c_regs, io, 15, 0, 0);
-
gpio_compute_location(io, 1, &shift, &mask);
if (high) {
@@ -101,8 +99,9 @@ gpio_set_output(volatile struct gpio_regs *regs, unsigned int io, bool high)
void
gpio_setup(void)
{
- gpio_set_af(gpio_c_regs, 6, 8, 1, 1); /* UART6 TX */
- gpio_set_af(gpio_c_regs, 7, 8, 1, 1); /* UART6 RX */
+ gpio_set_af(gpio_c_regs, 6, 8, 1, 1); /* UART6 TX */
+ gpio_set_af(gpio_c_regs, 7, 8, 1, 1); /* UART6 RX */
+ gpio_set_af(gpio_c_regs, 13, 15, 0, 0); /* LED */
}
void