diff --git a/src/shared/drivers/HardwareTimer.h b/src/shared/drivers/HardwareTimer.h index 4da7f7b2e9244c5dbe55f8df44d8758513626910..267014839b9ace07595246a649e8eb1a38daa2ec 100644 --- a/src/shared/drivers/HardwareTimer.h +++ b/src/shared/drivers/HardwareTimer.h @@ -40,22 +40,22 @@ public: * @brief returns the timer clock frequency before the prescaler. * Function borrowed from the SyncronizedServo class in Miosix. * - * @return unsigned int Prescaler input frequency + * @return Prescaler input frequency */ - static unsigned int getPrescalerInputFrequency(InputClock input_clock) + static uint32_t getPrescalerInputFrequency(InputClock input_clock) { // The global variable SystemCoreClock from ARM's CMSIS allows to // know // the CPU frequency. - unsigned int freq = SystemCoreClock; + uint32_t freq = SystemCoreClock; // The position of the PPRE1 bit in RCC->CFGR is different in some stm32 #ifdef _ARCH_CORTEXM3_STM32 - const unsigned int ppre1 = 8; + const uint32_t ppre1 = 8; #error "Architecture not currently supported" #else // stm32f2 and f4 - const unsigned int ppre1 = 10; - const unsigned int ppre2 = 13; + const uint32_t ppre1 = 10; + const uint32_t ppre2 = 13; #endif // The timer frequency may however be a submultiple of the CPU // frequency, @@ -104,7 +104,7 @@ public: * @param psc_input_freq Input frequency of the timer's prescaler, see * TimerUtils::getPrescalerInputFrequency() */ - HardwareTimer(TIM_TypeDef* timer, unsigned int psc_input_freq) + HardwareTimer(TIM_TypeDef* timer, uint32_t psc_input_freq) : tim(timer), prescaler_freq(psc_input_freq) { } @@ -187,7 +187,7 @@ public: private: TIM_TypeDef* tim; - unsigned int prescaler_freq; + uint32_t prescaler_freq; bool ticking = false; uint16_t prescaler = 0;