diff --git a/src/io.c b/src/io.c index 38404c0..e873978 100644 --- a/src/io.c +++ b/src/io.c @@ -58,7 +58,7 @@ void io_ext_watchdog_config(void) { #ifdef STM32L471xx GPIO_InitTypeDef.Mode = LL_GPIO_MODE_OUTPUT; GPIO_InitTypeDef.OutputType = LL_GPIO_OUTPUT_PUSHPULL; - GPIO_InitTypeDef.Pin = LL_GPIO_PIN_12; + GPIO_InitTypeDef.Pin = LL_GPIO_PIN_1; GPIO_InitTypeDef.Pull = LL_GPIO_PULL_NO; GPIO_InitTypeDef.Speed = LL_GPIO_SPEED_FREQ_MEDIUM; GPIO_InitTypeDef.Alternate = LL_GPIO_AF_7; @@ -72,7 +72,14 @@ void io_ext_watchdog_service(void) { #endif #ifdef STM32L471xx - + if ((GPIOA->ODR & GPIO_ODR_OD1) == 0) { + // set high + GPIOA->BSRR |= GPIO_BSRR_BS1; + } + else { + // set low + GPIOA->BSRR |= GPIO_BSRR_BR1; + } #endif } diff --git a/src/it_handlers.c b/src/it_handlers.c index b0c9e9c..c5bfaeb 100644 --- a/src/it_handlers.c +++ b/src/it_handlers.c @@ -31,6 +31,7 @@ #include "LedConfig.h" //#include "afsk.h" #include "diag/Trace.h" +#include "io.h" #include "station_config.h" @@ -183,6 +184,7 @@ void TIM7_IRQHandler(void) { #define ASC2 adc_sample_c2 AdcBuffer[ASC] = ADC1->DR; if(ASC == 3) { +// io_ext_watchdog_service(); AdcValue = (short int)(( AdcBuffer[0] + AdcBuffer[1] + AdcBuffer[2] + AdcBuffer[3]) >> 1); AFSK_ADC_ISR(&main_afsk, (AdcValue - 4095) ); led_control_led1_upper(main_ax25.dcd); diff --git a/system/src/cmsis/stm32l4xx/system_stm32l4xx.c b/system/src/cmsis/stm32l4xx/system_stm32l4xx.c index 11ecf52..ba1f30c 100644 --- a/system/src/cmsis/stm32l4xx/system_stm32l4xx.c +++ b/system/src/cmsis/stm32l4xx/system_stm32l4xx.c @@ -367,6 +367,9 @@ int SystemClock_Config_L4(void) // be sure that PLL is not running while ((RCC->CR & RCC_CR_PLLRDY) != 0); + // reset PLLCFGR register + RCC->PLLCFGR = 0; + // set the clock source for PLL RCC->PLLCFGR |= RCC_PLLCFGR_PLLSRC_HSE;