From 43ce7c0b9ad4f30277c10b086b86a0937dbfebbc Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 16 Dec 2023 22:00:23 -0500 Subject: 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 --- klippy/extras/angle.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'klippy/extras/angle.py') 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) -- cgit v1.2.3-70-g09d2