From 455ac1f9ad6a26078035026aa7d05d1687ed510a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstr=C3=B6m?= Date: Wed, 11 Dec 2024 10:50:37 +0100 Subject: [PATCH] Update lookuptable --- scripts/jinja2/ecmcYamlSchema.py | 4 ++-- scripts/jinja2/templates/encoder.jinja2 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/jinja2/ecmcYamlSchema.py b/scripts/jinja2/ecmcYamlSchema.py index 575c97bf7..35714eecd 100644 --- a/scripts/jinja2/ecmcYamlSchema.py +++ b/scripts/jinja2/ecmcYamlSchema.py @@ -281,8 +281,8 @@ def get_schema(self, keys): 'type': 'dict', 'schema': { 'filename': {'required': True, 'type': 'string'}, - 'mask': {'type': 'string'}, - 'enable': {'type': 'integer'}, + 'range': {'type': 'float'}, + 'enable': {'type': 'boolean'}, } }, 'unit': {'type': 'string'}, diff --git a/scripts/jinja2/templates/encoder.jinja2 b/scripts/jinja2/templates/encoder.jinja2 index 8017bb64a..e23a2f5ff 100644 --- a/scripts/jinja2/templates/encoder.jinja2 +++ b/scripts/jinja2/templates/encoder.jinja2 @@ -170,11 +170,11 @@ ecmcConfigOrDie "Cfg.SetAxisEncOffset(${ECMC_AXIS_NO},{{ encoder.absOffset }})" {%- if encoder.lookuptable is defined %} ecmcConfigOrDie "Cfg.LoadAxisEncLookupTable(${ECMC_AXIS_NO},{{ encoder.lookuptable.filename }})" - {%- if encoder.lookuptable.mask is defined %} - ecmcConfigOrDie "Cfg.SetAxisEncLookupTableRawPosMask(${ECMC_AXIS_NO},{{ encoder.lookuptable.mask }})" + {%- if encoder.lookuptable.range is defined %} + ecmcConfigOrDie "Cfg.SetAxisEncLookupTableRange(${ECMC_AXIS_NO},{{ encoder.lookuptable.range }})" {%- endif %} {%- if encoder.lookuptable.enable is defined %} - ecmcConfigOrDie "Cfg.SetAxisEncLookupTableEnable(${ECMC_AXIS_NO},{{ encoder.lookuptable.enable }})" + ecmcConfigOrDie "Cfg.SetAxisEncLookupTableEnable(${ECMC_AXIS_NO},{{ encoder.lookuptable.enable|int }})" {%- endif %} {%- endif %}