31 lines
929 B
Django/Jinja
31 lines
929 B
Django/Jinja
//
|
|
// WARNING: DO NOT EDIT THIS FILE
|
|
// This file has been generated from the target's JSON hardware description
|
|
//
|
|
|
|
{% set regular_switches = switches | selectattr('is_cfs','==',False) | list %}
|
|
{% set display_switches = regular_switches | selectattr('display','!=',None) | list %}
|
|
|
|
const hw_switch_def _switch_defs[] = {
|
|
{% for switch in switches %}
|
|
{% if switch.is_cfs %}
|
|
{ "{{ switch.name }}", SWITCH_HW_{{ switch.type }}, SWITCH_{{ switch.default }}, true, {{ switch.cfs_idx }} },
|
|
{% else %}
|
|
{ "{{ switch.name }}", SWITCH_HW_{{ switch.type }}, SWITCH_{{ switch.default }} },
|
|
{% endif %}
|
|
{% endfor %}
|
|
};
|
|
|
|
constexpr uint8_t n_switches = {{ switches | count }};
|
|
|
|
{% if display_switches | count > 0 %}
|
|
const switch_display_pos_t _switch_display[] = {
|
|
{% for sw in switches %}
|
|
{% if sw.display %}
|
|
{ {{ sw.display[0] }}, {{ sw.display[1] }} },
|
|
{% else %}
|
|
{ 0, 0 },
|
|
{% endif %}
|
|
{% endfor %}
|
|
};
|
|
{% endif %} |