From 4dd172d23557892dabb2e450f8776d351be54ad7 Mon Sep 17 00:00:00 2001 From: Jan Mrna Date: Sat, 16 May 2026 18:40:36 +0200 Subject: [PATCH] Reduce polarity switch time to 10 ms --- fw/Core/Src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fw/Core/Src/main.c b/fw/Core/Src/main.c index 7036529..beaa50d 100644 --- a/fw/Core/Src/main.c +++ b/fw/Core/Src/main.c @@ -137,8 +137,8 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ GPIO_PinState state = GPIO_PIN_RESET; - const uint32_t polarity_switch_period = 1000; - uint32_t next_polarity_switch_ms = HAL_GetTick() + polarity_switch_period; + const uint32_t polarity_switch_period_ms = 10; + uint32_t next_polarity_switch_ms = HAL_GetTick() + polarity_switch_period_ms; bool polarity = true; while (1) { @@ -162,7 +162,7 @@ int main(void) HAL_GPIO_WritePin(VDD_LEDL_EN_GPIO_Port, VDD_LEDL_EN_Pin, state); if (HAL_GetTick() > next_polarity_switch_ms) { - next_polarity_switch_ms = HAL_GetTick() + polarity_switch_period; + next_polarity_switch_ms = HAL_GetTick() + polarity_switch_period_ms; polarity = !polarity; H_bridge_set_direction(polarity); }