|
|
|
|
@ -17,7 +17,6 @@
|
|
|
|
|
******************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
/* USER CODE END Header */
|
|
|
|
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
|
|
@ -161,7 +160,6 @@ int main(void)
|
|
|
|
|
|
|
|
|
|
/* USER CODE END 1 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* MCU Configuration--------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
|
|
|
|
@ -215,7 +213,8 @@ void SystemClock_Config(void)
|
|
|
|
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
|
|
|
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
|
|
|
|
|
|
|
|
|
/** Initializes the CPU, AHB and APB busses clocks
|
|
|
|
|
/** Initializes the RCC Oscillators according to the specified parameters
|
|
|
|
|
* in the RCC_OscInitTypeDef structure.
|
|
|
|
|
*/
|
|
|
|
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
|
|
|
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
|
|
|
|
@ -228,7 +227,7 @@ void SystemClock_Config(void)
|
|
|
|
|
{
|
|
|
|
|
Error_Handler();
|
|
|
|
|
}
|
|
|
|
|
/** Initializes the CPU, AHB and APB busses clocks
|
|
|
|
|
/** Initializes the CPU, AHB and APB buses clocks
|
|
|
|
|
*/
|
|
|
|
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
|
|
|
|
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
|
|
|
|
@ -298,7 +297,7 @@ static void MX_TIM2_Init(void)
|
|
|
|
|
htim2.Instance = TIM2;
|
|
|
|
|
htim2.Init.Prescaler = 0;
|
|
|
|
|
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
|
|
|
|
htim2.Init.Period = 0;
|
|
|
|
|
htim2.Init.Period = 65535;
|
|
|
|
|
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
|
|
|
|
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
|
|
|
|
if (HAL_TIM_PWM_Init(&htim2) != HAL_OK)
|
|
|
|
|
@ -347,7 +346,7 @@ static void MX_TIM3_Init(void)
|
|
|
|
|
htim3.Instance = TIM3;
|
|
|
|
|
htim3.Init.Prescaler = 0;
|
|
|
|
|
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
|
|
|
|
htim3.Init.Period = 0;
|
|
|
|
|
htim3.Init.Period = 65535;
|
|
|
|
|
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
|
|
|
|
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
|
|
|
|
if (HAL_TIM_PWM_Init(&htim3) != HAL_OK)
|
|
|
|
|
|