fix: Throttle idle trim handling for surface, enable MT12 tests (#4520)

Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
3djc
2024-01-21 13:53:25 +10:00
committed by GitHub
co-authored by 3djc raphaelcoeffic
parent 4c2ea7a60a
commit dfaad73070
36 changed files with 596 additions and 1328 deletions
+26 -4
View File
@@ -3,11 +3,33 @@
// This file has been generated from the target's JSON hardware description
//
{% set inputs = adc_inputs.inputs | selectattr('type', '==', 'FLEX') | list %}
{% macro lua_input(first, offset, input) %}
{% set li = legacy_inputs[input.name] %}
{ {{ first }} + {{ offset }}, "{{ li.lua }}", "{{ li.description }}" },
{%- endmacro %}
{% macro lua_inputs(first, inputs) %}
{% for input in inputs %}
{{ lua_input(first, loop.index0, input) }}
{% endfor %}
{%- endmacro %}
static const LuaSingleField _lua_inputs[] = {
{% for input in inputs %}
{% set li = legacy_inputs[input.name] %}
{ MIXSRC_FIRST_POT + {{ loop.index0 }}, "{{ li.lua }}", "{{ li.description }}" },
// main inputs
{% set main_inputs = adc_inputs.inputs | selectattr('type', '==', 'STICK') | list %}
{{ lua_inputs('MIXSRC_FIRST_STICK', main_inputs) }}
// flex inputs
{% set inputs = adc_inputs.inputs | selectattr('type', '==', 'FLEX') | list %}
{{ lua_inputs('MIXSRC_FIRST_POT', inputs) }}
// trims
{% set trims_count = trims | count %}
{% for n in range(trims_count) %}
{% if n < (main_inputs | length) %}
{% set input = main_inputs[loop.index0] %}
{% set li = legacy_inputs[input.name] %}
{ MIXSRC_FIRST_TRIM + {{ loop.index0 }}, "trim-{{ li.lua }}", "{{ li.description}} trim" },
{% else %}
{ MIXSRC_FIRST_TRIM + {{ loop.index0 }}, "trim-t{{ loop.index }}", "Aux trim T{{ loop.index }}" },
{% endif %}
{% endfor %}
};