Commit 0a7e4fa5 authored by Daniel Campora's avatar Daniel Campora
Browse files

tests/wipy: Improve robustness of rtc_irq test.

parent 8192310d
......@@ -82,6 +82,8 @@ rtc.alarm(time=(2015, 8, 29, 9, 0, 45))
time.sleep_ms(1000)
left = rtc.alarm_left()
print(abs(left-44000) <= 90)
rtc.alarm_cancel()
rtc.deinit()
# next ones must raise
try:
......
......@@ -69,13 +69,13 @@ print(abs(t1 - t0 - 500) < 20)
# deep sleep repeated mode
rtc.alarm_cancel()
rtc_irq_count = 0
rtc.alarm(time=250, repeat=True)
rtc.alarm(time=500, repeat=True)
t0 = rtc_ticks_ms(rtc)
rtc_irq = rtc.irq(trigger=RTC.ALARM0, handler=alarm_handler, wake=Sleep.SUSPENDED)
while rtc_irq_count < 10:
while rtc_irq_count < 3:
Sleep.suspend()
t1 = rtc_ticks_ms(rtc)
print(abs(t1 - t0 - (250 * rtc_irq_count)) < 25)
print(abs(t1 - t0 - (500 * rtc_irq_count)) < 25)
# next ones must raise
try:
......
......@@ -7,12 +7,5 @@ True
True
True
True
True
True
True
True
True
True
True
Exception
Exception
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment