aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/angle.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-12-16 22:00:23 -0500
committerKevin O'Connor <kevin@koconnor.net>2023-12-26 11:47:21 -0500
commit43ce7c0b9ad4f30277c10b086b86a0937dbfebbc (patch)
tree8b18618378709bc580bc00048589581f57ceeb46 /klippy/extras/angle.py
parentd6a4669ce092496bb675a28732aa5f6a11360caf (diff)
downloadkutter-43ce7c0b9ad4f30277c10b086b86a0937dbfebbc.tar.gz
kutter-43ce7c0b9ad4f30277c10b086b86a0937dbfebbc.tar.xz
kutter-43ce7c0b9ad4f30277c10b086b86a0937dbfebbc.zip
adxl345: No need to implement is_measuring()
The APIDumpHelper class already ensures that the start/stop callbacks will only be called when needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/angle.py')
-rw-r--r--klippy/extras/angle.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/klippy/extras/angle.py b/klippy/extras/angle.py
index 26b9c6f0..5bfbb671 100644
--- a/klippy/extras/angle.py
+++ b/klippy/extras/angle.py
@@ -458,8 +458,6 @@ class Angle:
def get_status(self, eventtime=None):
return {'temperature': self.sensor_helper.last_temperature}
# Measurement collection
- def is_measuring(self):
- return self.start_clock != 0
def _extract_samples(self, raw_samples):
# Load variables to optimize inner loop below
sample_ticks = self.sample_ticks
@@ -527,8 +525,6 @@ class Angle:
return {'data': samples, 'errors': error_count,
'position_offset': offset}
def _start_measurements(self):
- if self.is_measuring():
- return
logging.info("Starting angle '%s' measurements", self.name)
self.sensor_helper.start()
# Start bulk reading
@@ -542,11 +538,8 @@ class Angle:
self.query_spi_angle_cmd.send([self.oid, reqclock, rest_ticks,
self.time_shift], reqclock=reqclock)
def _finish_measurements(self):
- if not self.is_measuring():
- return
# Halt bulk reading
params = self.query_spi_angle_end_cmd.send([self.oid, 0, 0, 0])
- self.start_clock = 0
self.bulk_queue.clear_samples()
self.sensor_helper.last_temperature = None
logging.info("Stopped angle '%s' measurements", self.name)