summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2022-01-19 14:57:36 +0100
committerCommit Bot <commit-bot@chromium.org>2022-01-19 17:58:05 +0000
commitd61fb7173c64dd87e931ec9c9b83167cc29e7318 (patch)
treec11897afccbb1d3824762789f2d46214d6f8186d
parent8bf27ea4b8c4ffc245f227e9a94d756f9d32649f (diff)
downloadchrome-ec-d61fb7173c64dd87e931ec9c9b83167cc29e7318.tar.gz
chip/stm32: Move IRQ_TIM to registers.h
This macro is used in many places, so let's move it to common location. BUG=b:200828093 BRANCH=none TEST=make -j buildall Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I55ec4f7776f494cbb976d50c91e6809c1827820f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398913 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
-rw-r--r--chip/stm32/hwtimer.c1
-rw-r--r--chip/stm32/hwtimer32.c2
-rw-r--r--chip/stm32/registers.h2
3 files changed, 2 insertions, 3 deletions
diff --git a/chip/stm32/hwtimer.c b/chip/stm32/hwtimer.c
index 84a193c14a..a1c51628f6 100644
--- a/chip/stm32/hwtimer.c
+++ b/chip/stm32/hwtimer.c
@@ -124,7 +124,6 @@
* Timers are defined per board. This gives us flexibility to work around
* timers which are dedicated to board-specific PWM sources.
*/
-#define IRQ_TIM(n) CONCAT2(STM32_IRQ_TIM, n)
#define IRQ_MSB IRQ_TIM(TIM_CLOCK_MSB)
#define IRQ_LSB IRQ_TIM(TIM_CLOCK_LSB)
#define IRQ_WD IRQ_TIM(TIM_WATCHDOG)
diff --git a/chip/stm32/hwtimer32.c b/chip/stm32/hwtimer32.c
index f4c1fe598f..f64eab989a 100644
--- a/chip/stm32/hwtimer32.c
+++ b/chip/stm32/hwtimer32.c
@@ -16,8 +16,6 @@
#include "timer.h"
#include "watchdog.h"
-#define IRQ_TIM(n) CONCAT2(STM32_IRQ_TIM, n)
-
void __hw_clock_event_set(uint32_t deadline)
{
/* set the match on the deadline */
diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h
index 74a195a54e..320a3852f1 100644
--- a/chip/stm32/registers.h
+++ b/chip/stm32/registers.h
@@ -142,6 +142,8 @@ struct timer_ctlr {
/* Must be volatile, or compiler optimizes out repeated accesses */
typedef volatile struct timer_ctlr timer_ctlr_t;
+#define IRQ_TIM(n) CONCAT2(STM32_IRQ_TIM, n)
+
/* --- Low power timers --- */
#define STM32_LPTIM_BASE(n) CONCAT3(STM32_LPTIM, n, _BASE)