diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2023-12-17 17:59:25 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-01-19 11:55:15 -0500 |
commit | 266e96621c0133e1192bbaec5addb6bcf443a203 (patch) | |
tree | 1f4396874db47db20aa75feb09757204c13b2c98 /klippy/extras/angle.py | |
parent | dc6182f3b339b990c8a68940f02a210e332be269 (diff) | |
download | kutter-266e96621c0133e1192bbaec5addb6bcf443a203.tar.gz kutter-266e96621c0133e1192bbaec5addb6bcf443a203.tar.xz kutter-266e96621c0133e1192bbaec5addb6bcf443a203.zip |
sensor_bulk: New C file with helper code for sending bulk sensor measurements
Refactor the low-level "bulk sensor" management code in the mcu. This
updates the sensor_adxl345.c, sensor_mpu9250.c, sensor_lis2dw.c, and
sensor_angle.c code to use the same "bulk sensor" messages. All of
these sensors will now send "sensor_bulk_data" and
"sensor_bulk_status" messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/angle.py')
-rw-r--r-- | klippy/extras/angle.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/angle.py b/klippy/extras/angle.py index 163168d0..23f402a7 100644 --- a/klippy/extras/angle.py +++ b/klippy/extras/angle.py @@ -412,7 +412,7 @@ class HelperTLE5012B: self._write_reg(reg, val) BYTES_PER_SAMPLE = 3 -SAMPLES_PER_BLOCK = 16 +SAMPLES_PER_BLOCK = bulk_sensor.MAX_BULK_MSG_SIZE // BYTES_PER_SAMPLE SAMPLE_PERIOD = 0.000400 BATCH_UPDATES = 0.100 @@ -445,7 +445,7 @@ class Angle: "query_spi_angle oid=%d clock=0 rest_ticks=0 time_shift=0" % (oid,), on_restart=True) mcu.register_config_callback(self._build_config) - self.bulk_queue = bulk_sensor.BulkDataQueue(mcu, "spi_angle_data", oid) + self.bulk_queue = bulk_sensor.BulkDataQueue(mcu, oid=oid) # Process messages in batches self.batch_bulk = bulk_sensor.BatchBulkHelper( self.printer, self._process_batch, |