From 4c5ac624455971549353d37597b2eaa172213995 Mon Sep 17 00:00:00 2001 From: Gianfranco Date: Sun, 16 Jul 2023 07:42:28 +0200 Subject: [PATCH] overflow value uint32_t -> uint64_t fix #2071 --- cores/arduino/HardwareTimer.h | 2 +- libraries/SrcWrapper/src/HardwareTimer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/HardwareTimer.h b/cores/arduino/HardwareTimer.h index d975ffb1b2..c019e44043 100644 --- a/cores/arduino/HardwareTimer.h +++ b/cores/arduino/HardwareTimer.h @@ -112,7 +112,7 @@ class HardwareTimer { void setPrescaleFactor(uint32_t prescaler); // set prescaler register (which is factor value - 1) uint32_t getPrescaleFactor(); - void setOverflow(uint32_t val, TimerFormat_t format = TICK_FORMAT); // set AutoReload register depending on format provided + void setOverflow(uint64_t val, TimerFormat_t format = TICK_FORMAT); // set AutoReload register depending on format provided uint32_t getOverflow(TimerFormat_t format = TICK_FORMAT); // return overflow depending on format provided void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrupt. diff --git a/libraries/SrcWrapper/src/HardwareTimer.cpp b/libraries/SrcWrapper/src/HardwareTimer.cpp index 231f53f41d..94d6ca7841 100644 --- a/libraries/SrcWrapper/src/HardwareTimer.cpp +++ b/libraries/SrcWrapper/src/HardwareTimer.cpp @@ -518,7 +518,7 @@ uint32_t HardwareTimer::getOverflow(TimerFormat_t format) * HERTZ_FORMAT: overflow is the frequency in hertz for overflow * @retval None */ -void HardwareTimer::setOverflow(uint32_t overflow, TimerFormat_t format) +void HardwareTimer::setOverflow(uint64_t overflow, TimerFormat_t format) { uint32_t ARR_RegisterValue; uint32_t PeriodTicks;