Ensure arrays in developer_opts.c have at least one element
This commit is contained in:
parent
c97eb85cd8
commit
0ccdd24d7e
|
@ -63,12 +63,14 @@ static struct {
|
||||||
const char *mcu, *var, *value;
|
const char *mcu, *var, *value;
|
||||||
} ptinj[] = {
|
} ptinj[] = {
|
||||||
// Add triples here, eg, {"ATmega328P", "mcuid", "999"},
|
// Add triples here, eg, {"ATmega328P", "mcuid", "999"},
|
||||||
|
{NULL, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
const char *mcu, *mem, *var, *value;
|
const char *mcu, *mem, *var, *value;
|
||||||
} meminj[] = {
|
} meminj[] = {
|
||||||
// Add quadruples here, eg, {"ATmega328P", "flash", "page_size", "128"},
|
// Add quadruples here, eg, {"ATmega328P", "flash", "page_size", "128"},
|
||||||
|
{NULL, NULL, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -713,9 +715,10 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool
|
||||||
|
|
||||||
if(injct)
|
if(injct)
|
||||||
for(size_t i=0; i<sizeof meminj/sizeof*meminj; i++)
|
for(size_t i=0; i<sizeof meminj/sizeof*meminj; i++)
|
||||||
if(strcmp(meminj[i].mcu, p->desc) == 0 && strcmp(meminj[i].mem, m->desc) == 0)
|
if(meminj[i].mcu)
|
||||||
dev_part_strct_entry(tsv, ".ptmm", p->desc, m->desc,
|
if(strcmp(meminj[i].mcu, p->desc) == 0 && strcmp(meminj[i].mem, m->desc) == 0)
|
||||||
meminj[i].var, cfg_strdup("meminj", meminj[i].value), NULL);
|
dev_part_strct_entry(tsv, ".ptmm", p->desc, m->desc,
|
||||||
|
meminj[i].var, cfg_strdup("meminj", meminj[i].value), NULL);
|
||||||
|
|
||||||
if(!tsv) {
|
if(!tsv) {
|
||||||
dev_cout(m->comments, ";", 0, 0);
|
dev_cout(m->comments, ";", 0, 0);
|
||||||
|
@ -735,9 +738,10 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool
|
||||||
|
|
||||||
if(injct)
|
if(injct)
|
||||||
for(size_t i=0; i<sizeof ptinj/sizeof*ptinj; i++)
|
for(size_t i=0; i<sizeof ptinj/sizeof*ptinj; i++)
|
||||||
if(strcmp(ptinj[i].mcu, p->desc) == 0)
|
if(ptinj[i].mcu)
|
||||||
dev_part_strct_entry(tsv, ".pt", p->desc, NULL,
|
if(strcmp(ptinj[i].mcu, p->desc) == 0)
|
||||||
ptinj[i].var, cfg_strdup("ptinj", ptinj[i].value), NULL);
|
dev_part_strct_entry(tsv, ".pt", p->desc, NULL,
|
||||||
|
ptinj[i].var, cfg_strdup("ptinj", ptinj[i].value), NULL);
|
||||||
|
|
||||||
if(!tsv) {
|
if(!tsv) {
|
||||||
dev_cout(p->comments, ";", 0, 0);
|
dev_cout(p->comments, ";", 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue