Change TIM_1_8_PERIOD_CLOCKS and add RCR

This commit is contained in:
Unknown
2018-10-23 21:18:33 -04:00
parent 8aac095bfd
commit 57d3836d93
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -67,12 +67,13 @@
/* Private define ------------------------------------------------------------*/
#define TIM_1_8_CLOCK_HZ 168000000
#define TIM_1_8_PERIOD_CLOCKS 10192
#define TIM_1_8_PERIOD_CLOCKS 3500
#define TIM_1_8_DEADTIME_CLOCKS 20
#define TIM_APB1_CLOCK_HZ 84000000
#define TIM_APB1_PERIOD_CLOCKS 4096
#define TIM_APB1_DEADTIME_CLOCKS 40
#define configAPPLICATION_ALLOCATED_HEAP 1
#define TIM_1_8_RCR 2
#define M0_nCS_Pin GPIO_PIN_13
#define M0_nCS_GPIO_Port GPIOC
+2 -2
View File
@@ -94,7 +94,7 @@ void MX_TIM1_Init(void)
htim1.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED3;
htim1.Init.Period = TIM_1_8_PERIOD_CLOCKS;
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;
htim1.Init.RepetitionCounter = TIM_1_8_RCR;
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
@@ -324,7 +324,7 @@ void MX_TIM8_Init(void)
htim8.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED3;
htim8.Init.Period = TIM_1_8_PERIOD_CLOCKS;
htim8.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim8.Init.RepetitionCounter = 0;
htim8.Init.RepetitionCounter = TIM_1_8_RCR;
if (HAL_TIM_PWM_Init(&htim8) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);