# HG changeset patch # User Ideenmodellierer # Date 1691695824 -7200 # Node ID 96ffad0a4e579a1c0bc966dea1a862da477bfbea # Parent 91d5ef16f1fd79eb76bd569da39559a16553020f Cleanup initialisation / deinitialization: The UART1 is now deactivated during sleep and will be reactivated with the default baudrate 19200. This avoid unpredicted behavior in case of sleep => awake transitions (always start from scratch) diff -r 91d5ef16f1fd -r 96ffad0a4e57 Small_CPU/Src/uart.c --- a/Small_CPU/Src/uart.c Thu Aug 10 21:27:58 2023 +0200 +++ b/Small_CPU/Src/uart.c Thu Aug 10 21:30:24 2023 +0200 @@ -55,15 +55,7 @@ /* regular init */ huart1.Instance = USART1; - - if(externalInterface_GetUARTProtocol() == 0x04) - { - huart1.Init.BaudRate = 19200; - } - else - { - huart1.Init.BaudRate = 9600; - } + huart1.Init.BaudRate = 19200; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; @@ -90,6 +82,7 @@ HAL_DMA_Abort(&hdma_usart1_rx); HAL_DMA_DeInit(&hdma_usart1_rx); HAL_UART_DeInit(&huart1); + dmaActive = 0; } void MX_USART1_DMA_Init()