probe_eddy_current: Allocate just enough SOS entries for filter
Support exporting the current SOS filter size from the DigitalFilter() class. Pass that value to the MCU_SosFilter() class to avoid allocating unneccessary MCU memory (previously 5 entries were allocated while only 3 are currently needed). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
1 parent
28c236df46
commit
c8b2ef0c21
2 files changed
+4
-1
No files matched your search
@@ -520,7 +520,8 @@ class EddyTap:
|
||||
# Create SOS filter
|
||||
cmd_queue = self._trigger_analog.get_dispatch().get_command_queue()
|
||||
mcu = self._sensor_helper.get_mcu()
|
||||
sos_filter = trigger_analog.MCU_SosFilter(mcu, cmd_queue, 5)
|
||||
filter_size = design.get_size()
|
||||
sos_filter = trigger_analog.MCU_SosFilter(mcu, cmd_queue, filter_size)
|
||||
self._trigger_analog.setup_sos_filter(sos_filter)
|
||||
def _prep_trigger_analog_tap(self, gcmd):
|
||||
if not self._tap_threshold:
|
||||
|
||||
@@ -68,6 +68,8 @@ class DigitalFilter:
|
||||
if self.initial_state is None:
|
||||
return [[0., 0.]] * len(self.filter_sections)
|
||||
return self.initial_state
|
||||
def get_size(self):
|
||||
return len(self.filter_sections)
|
||||
|
||||
# Control an `sos_filter` object on the MCU
|
||||
class MCU_SosFilter:
|
||||
|
||||
Reference in new issue
Block a user