mirror of
https://github.com/meshtastic/python.git
synced 2026-01-15 11:18:05 -05:00
poll for power readings much more rapidly - traces now look great
This commit is contained in:
@@ -63,7 +63,7 @@ class PPK2PowerSupply(PowerSupply):
|
||||
"""Endless measurement loop will run in a thread."""
|
||||
while self.measuring:
|
||||
with self.want_measurement:
|
||||
self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.01)
|
||||
self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.001)
|
||||
# normally we poll using this timeout, but sometimes
|
||||
# reset_measurement() will notify us to read immediately
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ log_regex = re.compile(".*S:([0-9A-Za-z]+):(.*)")
|
||||
class PowerLogger:
|
||||
"""Logs current watts reading periodically using PowerMeter and ArrowWriter."""
|
||||
|
||||
def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.2) -> None:
|
||||
def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.01) -> None:
|
||||
"""Initialize the PowerLogger object."""
|
||||
self.pMeter = pMeter
|
||||
self.writer = FeatherWriter(file_path)
|
||||
|
||||
Reference in New Issue
Block a user