Skip to content

Commit 1e38f94

Browse files
JasonLin-RealTekkartben
authored andcommitted
drivers: timer : fix rtmr timer.
RTMR clear the interrupt status bit in the init and isr function. Signed-off-by: Lin Yu-Cheng <[email protected]>
1 parent 843d661 commit 1e38f94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/timer/realtek_rts5912_rtmr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ static void rtmr_isr(const void *arg)
7474

7575
k_spinlock_key_t key = k_spin_lock(&lock);
7676

77+
RTMR_REG->INTSTS = RTOSTMR_INTSTS_STS_Msk;
78+
7779
rtmr_restart(RTMR_COUNTER_MAX * CYCLES_PER_TICK);
7880

7981
cycles = previous_cnt;
@@ -220,6 +222,8 @@ void arch_busy_wait(uint32_t n_usec)
220222
static int sys_clock_driver_init(void)
221223
{
222224
/* Enable RTMR clock power */
225+
RTMR_REG->INTSTS = RTOSTMR_INTSTS_STS_Msk;
226+
NVIC_ClearPendingIRQ(DT_INST_IRQN(0));
223227

224228
SYSTEM_Type *sys_reg = RTS5912_SCCON_REG_BASE;
225229

0 commit comments

Comments
 (0)