mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-05-07 03:16:53 +02:00
trigger_analog: Require trigger_value to be an integer
Have the callers convert convert the trigger_value from a float to an integer (if necessary). This is in preparation for implementing rounding in to_fixed_32(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -332,7 +332,7 @@ class LoadCellProbingMove:
|
||||
sos_filter.set_offset_scale(int(-tare_counts), gpc, Q17_14_FRAC_BITS)
|
||||
# update trigger
|
||||
trigger_val = self._config_helper.get_trigger_force_grams(gcmd)
|
||||
trigger_frac_grams = trigger_val * FRAC_GRAMS_CONV
|
||||
trigger_frac_grams = int(trigger_val * FRAC_GRAMS_CONV)
|
||||
self._mcu_trigger_analog.set_trigger("abs_ge", trigger_frac_grams)
|
||||
|
||||
# Probe towards z_min until the trigger_analog on the MCU triggers
|
||||
|
||||
@@ -333,7 +333,7 @@ class MCU_trigger_analog:
|
||||
self._set_raw_range_cmd.send(args)
|
||||
self._last_range_args = args
|
||||
# Update trigger in mcu (if it has changed)
|
||||
args = [self._oid, self._trigger_type, to_fixed_32(self._trigger_value)]
|
||||
args = [self._oid, self._trigger_type, self._trigger_value]
|
||||
if args != self._last_trigger_args:
|
||||
self._set_trigger_cmd.send(args)
|
||||
self._last_trigger_args = args
|
||||
|
||||
Reference in New Issue
Block a user