Ignore:
Timestamp:
Jun 12, 2023, 12:09:16 PM (19 months ago)
Author:
f.jahn
Message:

IWDG HAL library version is changed to 1.4.1 for better compatibility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ecs_cellMon/firmware/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c

    r9 r10  
    99  *           + IO operation functions
    1010  *
    11   ******************************************************************************
    12   * @attention
    13   *
    14   * Copyright (c) 2018 STMicroelectronics.
    15   * All rights reserved.
    16   *
    17   * This software is licensed under terms that can be found in the LICENSE file
    18   * in the root directory of this software component.
    19   * If no LICENSE file comes with this software, it is provided AS-IS.
    20   *
    21   ******************************************************************************
    2211  @verbatim
    2312  ==============================================================================
     
    7766           value will be loaded in the IWDG counter each time the watchdog is
    7867           reloaded, then the IWDG will start counting down from this value.
     68      (++) Wait for status flags to be reset.
    7969      (++) Depending on window parameter:
    8070        (+++) If Window Init parameter is same as Window register value,
     
    8373        (+++) Else modify Window register. This will automatically reload
    8474             watchdog counter.
    85       (++) Wait for status flags to be reset.
    8675
    8776    (#) Then the application program must refresh the IWDG counter at regular
     
    9887
    9988  @endverbatim
     89  ******************************************************************************
     90  * @attention
     91  *
     92  * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
     93  * All rights reserved.</center></h2>
     94  *
     95  * This software component is licensed by ST under BSD 3-Clause license,
     96  * the "License"; You may not use this file except in compliance with the
     97  * License. You may obtain a copy of the License at:
     98  *                        opensource.org/licenses/BSD-3-Clause
     99  *
     100  ******************************************************************************
    100101  */
    101102
     
    121122   prescaler to be updated. The number of LSI clock periods is upper-rounded to
    122123   6 for the timeout value calculation.
    123    The timeout value is calculated using the highest prescaler (256) and
     124   The timeout value is also calculated using the highest prescaler (256) and
    124125   the LSI_VALUE constant. The value of this constant can be changed by the user
    125126   to take into account possible LSI clock period variations.
    126    The timeout value is multiplied by 1000 to be converted in milliseconds.
    127    LSI startup time is also considered here by adding LSI_STARTUP_TIME
    128    converted in milliseconds. */
    129 #define HAL_IWDG_DEFAULT_TIMEOUT        (((6UL * 256UL * 1000UL) / LSI_VALUE) + ((LSI_STARTUP_TIME / 1000UL) + 1UL))
    130 #define IWDG_KERNEL_UPDATE_FLAGS        (IWDG_SR_WVU | IWDG_SR_RVU | IWDG_SR_PVU)
     127   The timeout value is multiplied by 1000 to be converted in milliseconds. */
     128#define HAL_IWDG_DEFAULT_TIMEOUT ((6UL * 256UL * 1000UL) / LSI_VALUE)
    131129/**
    132130  * @}
     
    199197
    200198  /* Wait for register to be updated */
    201   while ((hiwdg->Instance->SR & IWDG_KERNEL_UPDATE_FLAGS) != 0x00u)
     199  while (hiwdg->Instance->SR != 0x00u)
    202200  {
    203201    if ((HAL_GetTick() - tickstart) > HAL_IWDG_DEFAULT_TIMEOUT)
    204202    {
    205       if ((hiwdg->Instance->SR & IWDG_KERNEL_UPDATE_FLAGS) != 0x00u)
    206       {
    207         return HAL_TIMEOUT;
    208       }
     203      return HAL_TIMEOUT;
    209204    }
    210205  }
     
    229224}
    230225
    231 
    232226/**
    233227  * @}
     
    248242  * @{
    249243  */
     244
    250245
    251246/**
     
    264259}
    265260
    266 
    267261/**
    268262  * @}
     
    281275  * @}
    282276  */
     277
     278/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Note: See TracChangeset for help on using the changeset viewer.