Skip to content

Commit 405ce3d

Browse files
committed
monitor.py: Remove f-strings for ESP8266 compatibility.
1 parent 8282ff1 commit 405ce3d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

v3/as_demos/monitor/monitor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def _validate(ident, num=1):
5050
for x in range(ident, ident + num):
5151
_available.remove(x)
5252
except KeyError:
53-
_quit(f"error - ident {x:02} already allocated.")
53+
_quit("error - ident {:02d} already allocated.".format(x))
5454
else:
55-
_quit(f"error - ident {ident:02} out of range.")
55+
_quit("error - ident {:02d} out of range.".format(ident))
5656

5757
# Reserve ID's to be used for synchronous monitoring
5858
def reserve(*ids):
@@ -63,7 +63,7 @@ def reserve(*ids):
6363
# Check whether a synchronous ident was reserved
6464
def _check(ident):
6565
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))
6767

6868
# asynchronous monitor
6969
def asyn(n, max_instances=1):
@@ -78,7 +78,7 @@ async def wrapped_coro(*args, **kwargs):
7878
v = int.to_bytes(d, 1, "big")
7979
instance += 1
8080
if instance > max_instances: # Warning only
81-
print(f"Monitor {n:02} max_instances reached")
81+
print("Monitor {:02d} max_instances reached.".format(n))
8282
_write(v)
8383
try:
8484
res = await coro(*args, **kwargs)

v3/as_demos/monitor/monitor_pico.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def read():
118118
h_max = 0 # Restart timing
119119
h_start = 0
120120
for pin in pins:
121-
pin[1] = 0 # Clear instance counters
121+
pin[0](0) # Clear pin
122+
pin[1] = 0 # and instance counter
122123
continue
123124
if x == 0x40: # hog_detect task has started.
124125
t = ticks_ms() # Arrival time

0 commit comments

Comments
 (0)