LCOV - code coverage report
Current view: top level - uart/src - stm32f4_uart_util.c (source / functions) Hit Total Coverage
Test: filtered.info Lines: 2 2 100.0 %
Date: 2025-12-18 00:00:35 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             :  * @file stm32f4_uart_util.c
       3             :  * @brief Provides common calculations for UART channels.
       4             :  *
       5             :  * Copyright (c) 2025 Cory McKiel.
       6             :  * Licensed under the MIT License. See LICENSE file in the project root.
       7             :  */
       8             : #include "stm32f4_uart_util.h"
       9             : 
      10          60 : uint16_t stm32f4_hal_compute_uart_bd(uint32_t periph_clk, uint32_t baud_rate)
      11             : {
      12             :         // Common rounding trick for integers:
      13             :         // result = (numerator * scale + divisor/2) / divisor;
      14          60 :         return ((periph_clk + (baud_rate/2U)) / baud_rate);
      15             : }

Generated by: LCOV version 1.14