Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: Marsu42 on July 11, 2013, 04:08:44 PM

Title: CONFIG_ARRAY_ELEMENT impossible in modules?!
Post by: Marsu42 on July 11, 2013, 04:08:44 PM
I'm trying to use the method from hdr.c for array variables in my module, but it won't work - is it me or isn't this supported in modules (yet? if so, please do add :-)) ... this is part of my (abridged) module code:


static int8_t mymodule_var[2];
CONFIG_ARRAY_ELEMENT("mymodule.var.0", mymodule_var, 0, -1);
CONFIG_ARRAY_ELEMENT("mymodule.var.1", mymodule_var, 1, -1);

MODULE_CONFIGS_START()
    MODULE_CONFIG(mymodule_var)
MODULE_CONFIGS_END()


... and this is the compiler error:


[ CC       ]   mymodule.o
mymodule.c:6:1: error: '__config_mymodule_var' undeclared here (not in a function)
make[1]: *** [mymodule.o] Error 1
make[1]: Leaving directory `/ml/magic-lantern/modules/mymodule'
make: *** [mymodule] Error 2
Title: Re: CONFIG_ARRAY_ELEMENT impossible in modules?!
Post by: g3gg0 on July 11, 2013, 04:45:26 PM
sorry, this is not possible yet.
Title: Re: CONFIG_ARRAY_ELEMENT impossible in modules?!
Post by: Marsu42 on July 11, 2013, 05:01:33 PM
Quote from: g3gg0 on July 11, 2013, 04:45:26 PM
sorry, this is not possible yet.

Hmmmm, in this case feel free to add it :-) - if the modules support everything you can do in the core, there is less need to patch the core and thus avoids a bit hassle for all concerned parties :-o