File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ def _validate(ident, num=1):
50
50
for x in range (ident , ident + num ):
51
51
_available .remove (x )
52
52
except KeyError :
53
- _quit (f "error - ident { x :02 } already allocated." )
53
+ _quit ("error - ident {:02d } already allocated." . format ( x ) )
54
54
else :
55
- _quit (f "error - ident { ident :02 } out of range." )
55
+ _quit ("error - ident {:02d } out of range." . format ( ident ) )
56
56
57
57
# Reserve ID's to be used for synchronous monitoring
58
58
def reserve (* ids ):
@@ -63,7 +63,7 @@ def reserve(*ids):
63
63
# Check whether a synchronous ident was reserved
64
64
def _check (ident ):
65
65
if ident not in _reserved :
66
- _quit (f "error: synchronous ident { ident :02 } was not reserved." )
66
+ _quit ("error: synchronous ident {:02d } was not reserved." . format ( ident ) )
67
67
68
68
# asynchronous monitor
69
69
def asyn (n , max_instances = 1 ):
@@ -78,7 +78,7 @@ async def wrapped_coro(*args, **kwargs):
78
78
v = int .to_bytes (d , 1 , "big" )
79
79
instance += 1
80
80
if instance > max_instances : # Warning only
81
- print (f "Monitor { n :02 } max_instances reached" )
81
+ print ("Monitor {:02d } max_instances reached." . format ( n ) )
82
82
_write (v )
83
83
try :
84
84
res = await coro (* args , ** kwargs )
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ def read():
118
118
h_max = 0 # Restart timing
119
119
h_start = 0
120
120
for pin in pins :
121
- pin [1 ] = 0 # Clear instance counters
121
+ pin [0 ](0 ) # Clear pin
122
+ pin [1 ] = 0 # and instance counter
122
123
continue
123
124
if x == 0x40 : # hog_detect task has started.
124
125
t = ticks_ms () # Arrival time
You can’t perform that action at this time.
0 commit comments