From cbeeca91a9be417c065063674677c67294c23aa5 Mon Sep 17 00:00:00 2001 From: Sebastian Renner Date: Mon, 22 Jul 2019 15:08:34 +0200 Subject: [PATCH] F7 GPIO guard --- templates/f7/Src/main.c | 11 +++++++++++ templates/f7/middleware.py | 1 + 2 files changed, 12 insertions(+) diff --git a/templates/f7/Src/main.c b/templates/f7/Src/main.c index 3cc530f..e7b69f9 100644 --- a/templates/f7/Src/main.c +++ b/templates/f7/Src/main.c @@ -371,6 +371,17 @@ static void MX_GPIO_Init(void) LL_GPIO_ResetOutputPin(LD2_GPIO_Port, LD2_Pin); /**/ + LL_GPIO_SetOutputPin(GPIOD, LL_GPIO_PIN_7); + + /**/ + GPIO_InitStruct.Pin = LL_GPIO_PIN_7; + GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; + LL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + /**/ GPIO_InitStruct.Pin = LL_GPIO_PIN_0; GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; diff --git a/templates/f7/middleware.py b/templates/f7/middleware.py index 627ba43..92d3785 100755 --- a/templates/f7/middleware.py +++ b/templates/f7/middleware.py @@ -54,6 +54,7 @@ def submit(channel, action, data): else: h = struct.pack("