/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file iwdg.c * @brief This file provides code for the configuration * of the IWDG instances. ****************************************************************************** * @attention * * Copyright (c) 2026 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "iwdg.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ IWDG_HandleTypeDef hiwdg; /* IWDG init function */ void MX_IWDG_Init(void) { /* USER CODE BEGIN IWDG_Init 0 */ #if defined(MINI7_V2_DEBUG) return ; #endif /* USER CODE END IWDG_Init 0 */ /* USER CODE BEGIN IWDG_Init 1 */ /* USER CODE END IWDG_Init 1 */ hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_64; hiwdg.Init.Reload = 1230; if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN IWDG_Init 2 */ /* USER CODE END IWDG_Init 2 */ } /* USER CODE BEGIN 1 */ void Refresh_IWDG(void){ #if defined(MINI7_V2_DEBUG) return ; #endif HAL_IWDG_Refresh(&hiwdg); } unsigned int CheckIsIwdgReset() { if(__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST)){ __HAL_RCC_CLEAR_RESET_FLAGS(); return 1; } return 0; } /* USER CODE END 1 */