Commit 105407c9 authored by Chris Woodall's avatar Chris Woodall
Browse files

Calculate the size of the non-volatile buffer, and if it is 0 do not make one.

parent e5a0408c
Pipeline #8603 failed with stage
in 1 minute and 48 seconds
......@@ -50,7 +50,7 @@ static uint32_t volatile_buffer[] = {
0,
{%- else %}
{%- if entry.constdefault %}
{{ entry.constdefault if entry.constdefault else 0 }}, // Default for {{ entry.name }}
{{ entry.constdefault }}, // Default for {{ entry.name }}
{%- else %}
{{ entry.default if entry.default else 0 }}, // Default for {{ entry.name }}
{%- endif %}
......@@ -59,11 +59,13 @@ static uint32_t volatile_buffer[] = {
{%- endfor %}
};
{%- if not master %}
static uint32_t nv_buffer[] = {
{%- set nv_length = objdict.indexes|selectattr('save', 'equalto', True)|list|length %}
{%- if not master and nv_length > 0 %}
static uint32_t nv_buffer[{{nv_length}}] = {
{%- for entry in objdict.indexes if entry.save %}
{%- if entry.constdefault %}
{{ entry.constdefault if entry.constdefault else 0 }}, // Default for {{ entry.name }}
{{ entry.constdefault }}, // Default for {{ entry.name }}
{%- else %}
{{ entry.default if entry.default else 0 }}, // Default for {{ entry.name }}
{%- endif %}
......
#!/usr/bin/env python3
__version__ = "1.0.2"
__version__ = "1.0.3"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment