Skip to content

Commit 0a7e4fa

Browse files
author
Daniel Campora
committed
tests/wipy: Improve robustness of rtc_irq test.
1 parent 8192310 commit 0a7e4fa

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

tests/wipy/rtc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def set_and_print(datetime):
8282
time.sleep_ms(1000)
8383
left = rtc.alarm_left()
8484
print(abs(left-44000) <= 90)
85+
rtc.alarm_cancel()
86+
rtc.deinit()
8587

8688
# next ones must raise
8789
try:

tests/wipy/rtc_irq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ def alarm_handler (rtc_o):
6969
# deep sleep repeated mode
7070
rtc.alarm_cancel()
7171
rtc_irq_count = 0
72-
rtc.alarm(time=250, repeat=True)
72+
rtc.alarm(time=500, repeat=True)
7373
t0 = rtc_ticks_ms(rtc)
7474
rtc_irq = rtc.irq(trigger=RTC.ALARM0, handler=alarm_handler, wake=Sleep.SUSPENDED)
75-
while rtc_irq_count < 10:
75+
while rtc_irq_count < 3:
7676
Sleep.suspend()
7777
t1 = rtc_ticks_ms(rtc)
78-
print(abs(t1 - t0 - (250 * rtc_irq_count)) < 25)
78+
print(abs(t1 - t0 - (500 * rtc_irq_count)) < 25)
7979

8080
# next ones must raise
8181
try:

tests/wipy/rtc_irq.py.exp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,5 @@ True
77
True
88
True
99
True
10-
True
11-
True
12-
True
13-
True
14-
True
15-
True
16-
True
1710
Exception
1811
Exception

0 commit comments

Comments
 (0)