File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,28 @@ def cb4(t):
2222 return cb4
2323
2424# create a timer with a callback, using callback(None) to stop
25- tim = Timer (1 , freq = 1000 , callback = cb1 )
26- pyb .delay (10 )
25+ tim = Timer (1 , freq = 100 , callback = cb1 )
26+ pyb .delay (5 )
27+ print ("before cb1" )
28+ pyb .delay (15 )
2729
2830# create a timer with a callback, using deinit to stop
29- tim = Timer (2 , freq = 1000 , callback = cb2 )
30- pyb .delay (10 )
31+ tim = Timer (2 , freq = 100 , callback = cb2 )
32+ pyb .delay (5 )
33+ print ("before cb2" )
34+ pyb .delay (15 )
3135
3236# create a timer, then set the freq, then set the callback
3337tim = Timer (4 )
34- tim .init (freq = 2000 )
38+ tim .init (freq = 100 )
3539tim .callback (cb1 )
36- pyb .delay (10 )
40+ pyb .delay (5 )
41+ print ("before cb1" )
42+ pyb .delay (15 )
3743
3844# test callback with a closure
39- tim .init (freq = 3000 )
45+ tim .init (freq = 100 )
4046tim .callback (cb3 (3 ))
41- pyb .delay (10 )
47+ pyb .delay (5 )
48+ print ("before cb4" )
49+ pyb .delay (15 )
Original file line number Diff line number Diff line change 1+ before cb1
12cb1
3+ before cb2
24cb2
5+ before cb1
36cb1
7+ before cb4
48cb4 3
You can’t perform that action at this time.
0 commit comments