初始版本
This commit is contained in:
73
Src/wwdg.c
Normal file
73
Src/wwdg.c
Normal file
@ -0,0 +1,73 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file wwdg.c
|
||||
* @brief This file provides code for the configuration
|
||||
* of the WWDG instances.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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 "wwdg.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
WWDG_HandleTypeDef hwwdg;
|
||||
|
||||
/* WWDG init function */
|
||||
void MX_WWDG_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN WWDG_Init 0 */
|
||||
|
||||
/* USER CODE END WWDG_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN WWDG_Init 1 */
|
||||
|
||||
/* USER CODE END WWDG_Init 1 */
|
||||
hwwdg.Instance = WWDG;
|
||||
hwwdg.Init.Prescaler = WWDG_PRESCALER_1;
|
||||
hwwdg.Init.Window = 64;
|
||||
hwwdg.Init.Counter = 64;
|
||||
hwwdg.Init.EWIMode = WWDG_EWI_DISABLE;
|
||||
if (HAL_WWDG_Init(&hwwdg) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN WWDG_Init 2 */
|
||||
|
||||
/* USER CODE END WWDG_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_WWDG_MspInit(WWDG_HandleTypeDef* wwdgHandle)
|
||||
{
|
||||
|
||||
if(wwdgHandle->Instance==WWDG)
|
||||
{
|
||||
/* USER CODE BEGIN WWDG_MspInit 0 */
|
||||
|
||||
/* USER CODE END WWDG_MspInit 0 */
|
||||
/* WWDG clock enable */
|
||||
__HAL_RCC_WWDG_CLK_ENABLE();
|
||||
/* USER CODE BEGIN WWDG_MspInit 1 */
|
||||
|
||||
/* USER CODE END WWDG_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
Reference in New Issue
Block a user