From 0b33d7e997a9859dda52246cbe45a1e61792e211 Mon Sep 17 00:00:00 2001 From: Mateusz Lubecki Date: Fri, 16 Jul 2021 11:11:11 +0200 Subject: [PATCH] daily --- include/LedConfig.h | 10 +++++----- system/src/drivers/analog_anemometer.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/LedConfig.h b/include/LedConfig.h index 7080fb6..6c5cadf 100644 --- a/include/LedConfig.h +++ b/include/LedConfig.h @@ -100,10 +100,10 @@ inline void led_control_led1_upper(bool _in) { inline void led_control_led2_bottom(bool _in) { if (_in == true) { - GPIOC->BSRR |= GPIO_BSRR_BS9; + GPIOA->BSRR |= GPIO_BSRR_BS5; } else { - GPIOC->BSRR |= GPIO_BSRR_BR9; + GPIOA->BSRR |= GPIO_BSRR_BR5; } } @@ -117,11 +117,11 @@ inline void led_flip_led1_upper(void) { } inline void led_flip_led2_bottom(void) { - if ((GPIOC->ODR & GPIO_ODR_ODR_9) == GPIO_ODR_ODR_9) { - GPIOC->BSRR |= GPIO_BSRR_BR9; + if ((GPIOA->ODR & GPIO_ODR_ODR_5) == GPIO_ODR_ODR_5) { + GPIOA->BSRR |= GPIO_BSRR_BR5; } else { - GPIOC->BSRR |= GPIO_BSRR_BS9; + GPIOA->BSRR |= GPIO_BSRR_BS5; } } diff --git a/system/src/drivers/analog_anemometer.c b/system/src/drivers/analog_anemometer.c index 78d30ab..660fba1 100644 --- a/system/src/drivers/analog_anemometer.c +++ b/system/src/drivers/analog_anemometer.c @@ -273,7 +273,7 @@ void analog_anemometer_init(uint16_t pulses_per_meter_second, uint8_t anemometer NVIC_EnableIRQ( DMA1_Channel5_IRQn ); // direction - GPIO_InitTypeDef.Mode = LL_GPIO_MODE_INPUT; + GPIO_InitTypeDef.Mode = LL_GPIO_MODE_ALTERNATE; GPIO_InitTypeDef.Pin = LL_GPIO_PIN_2; GPIO_InitTypeDef.Pull = LL_GPIO_PULL_NO; GPIO_InitTypeDef.Speed = LL_GPIO_SPEED_FREQ_MEDIUM; @@ -534,7 +534,7 @@ int16_t analog_anemometer_direction_handler(void) { LL_TIM_DisableCounter(TIM3); // getting current counter value - uint16_t current_value = LL_TIM_GetCounter(TIM3);//TIM_GetCounter(TIM3); + volatile uint16_t current_value = LL_TIM_GetCounter(TIM3);//TIM_GetCounter(TIM3); // if the counter value is zero it means that probably U/f converter isn't running if (current_value == 0) {