File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ def set_and_print(datetime):
8282time .sleep_ms (1000 )
8383left = rtc .alarm_left ()
8484print (abs (left - 44000 ) <= 90 )
85+ rtc .alarm_cancel ()
86+ rtc .deinit ()
8587
8688# next ones must raise
8789try :
Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ def alarm_handler (rtc_o):
6969# deep sleep repeated mode
7070rtc .alarm_cancel ()
7171rtc_irq_count = 0
72- rtc .alarm (time = 250 , repeat = True )
72+ rtc .alarm (time = 500 , repeat = True )
7373t0 = rtc_ticks_ms (rtc )
7474rtc_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
8181try :
Original file line number Diff line number Diff line change 77True
88True
99True
10- True
11- True
12- True
13- True
14- True
15- True
16- True
1710Exception
1811Exception
You can’t perform that action at this time.
0 commit comments