mirror of
git://soft.sys114.com/klipper
synced 2026-02-11 19:20:26 +09:00
adxl345: Renamed decode_samples and fixed/added checks on empty data
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This commit is contained in:
committed by
KevinOConnor
parent
f72a2dc1ab
commit
91466ebd43
@@ -183,12 +183,12 @@ class ResonanceTester:
|
||||
"%s file" % (raw_name,))
|
||||
if helper is None:
|
||||
continue
|
||||
for chip_axis, chip_values in raw_values:
|
||||
if not chip_values:
|
||||
for chip_axis, aclient in raw_values:
|
||||
if not aclient.has_valid_samples():
|
||||
raise gcmd.error(
|
||||
"%s-axis accelerometer measured no data" % (
|
||||
chip_axis,))
|
||||
new_data = helper.process_accelerometer_data(chip_values)
|
||||
new_data = helper.process_accelerometer_data(aclient)
|
||||
if calibration_data[axis] is None:
|
||||
calibration_data[axis] = new_data
|
||||
else:
|
||||
@@ -285,6 +285,9 @@ class ResonanceTester:
|
||||
aclient.finish_measurements()
|
||||
helper = shaper_calibrate.ShaperCalibrate(self.printer)
|
||||
for chip_axis, aclient in raw_values:
|
||||
if not aclient.has_valid_samples():
|
||||
raise gcmd.error(
|
||||
"%s-axis accelerometer measured no data" % (chip_axis,))
|
||||
data = helper.process_accelerometer_data(aclient)
|
||||
vx = data.psd_x.mean()
|
||||
vy = data.psd_y.mean()
|
||||
|
||||
Reference in New Issue
Block a user