V2.31
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : main.c
|
||||
* Author : WCH
|
||||
* Version : V1.0.0
|
||||
* Date : 2021/06/06
|
||||
* Version : V1.0.1
|
||||
* Date : 2025/09/26
|
||||
* Description : Main program body.
|
||||
*********************************************************************************
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
@@ -30,9 +30,9 @@
|
||||
#define PWM_MODE PWM_MODE2
|
||||
|
||||
/*********************************************************************
|
||||
* @fn TIM1_OutCompare_Init
|
||||
* @fn TIM1_PWMOut_Init
|
||||
*
|
||||
* @brief Initializes TIM1 output compare.
|
||||
* @brief Initializes TIM1 PWM Output.
|
||||
*
|
||||
* @param arr - the period value.
|
||||
* psc - the prescaler value.
|
||||
@@ -53,7 +53,7 @@ void TIM1_PWMOut_Init(u16 arr, u16 psc, u16 ccp)
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init( GPIOA, &GPIO_InitStructure );
|
||||
|
||||
TIM_TimeBaseInitStructure.TIM_Period = arr;
|
||||
TIM_TimeBaseInitStructure.TIM_Period = arr-1;
|
||||
TIM_TimeBaseInitStructure.TIM_Prescaler = psc;
|
||||
TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
|
||||
TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||
|
||||
Reference in New Issue
Block a user