Mercurial > pub > halpp
comparison l476rg/Src/stm32l4xx_hal_timebase_TIM.c @ 4:ca4f5b55b391
working on pwm
author | cin |
---|---|
date | Wed, 18 Jan 2017 03:27:00 +0300 |
parents | 32a3b1785697 |
children |
comparison
equal
deleted
inserted
replaced
3:3d9705e842f8 | 4:ca4f5b55b391 |
---|---|
78 | 78 |
79 /* Get clock configuration */ | 79 /* Get clock configuration */ |
80 HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); | 80 HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); |
81 | 81 |
82 /* Compute TIM6 clock */ | 82 /* Compute TIM6 clock */ |
83 uwTimclock = HAL_RCC_GetPCLK1Freq(); | 83 uwTimclock = 2*HAL_RCC_GetPCLK1Freq(); |
84 | 84 |
85 /* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */ | 85 /* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */ |
86 uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1); | 86 uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1); |
87 | 87 |
88 /* Initialize TIM6 */ | 88 /* Initialize TIM6 */ |