Skip to content

Commit c1b3d9c

Browse files
committed
Enable test for RT700 irtc driver.
1. Update overlay and project conf for RT700. 2. Update test_alarm.c to disable RTC irq so that callback function won't be called to clear the pending interrupt. Signed-off-by: Holt.Sun <holt.sun@nxp.com>
1 parent cd40623 commit c1b3d9c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_RTC_ALARM=y
2+
CONFIG_TEST_RTC_ALARM_TIME_MASK=63
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
rtc = &rtc0;
10+
};
11+
};
12+
13+
&rtc0 {
14+
status = "okay";
15+
};

tests/drivers/rtc/rtc_api/src/test_alarm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ ZTEST(rtc_api, test_alarm)
174174
}
175175
}
176176

177+
/* Disable RTC IRQ, the irq will clear the alarm pending flag thus affects the test */
178+
irq_disable(DT_IRQN(DT_ALIAS(rtc)));
179+
177180
for (uint8_t k = 0; k < 2; k++) {
178181
/* Set RTC time */
179182
ret = rtc_set_time(rtc, &test_rtc_time_set);
@@ -212,4 +215,7 @@ ZTEST(rtc_api, test_alarm)
212215
ret = rtc_alarm_is_pending(rtc, i);
213216
zassert_true(ret > -1, "Failed to clear alarm %d pending state", i);
214217
}
218+
219+
/* Re-enable IRQ after test */
220+
irq_enable(DT_IRQN(DT_ALIAS(rtc)));
215221
}

0 commit comments

Comments
 (0)