Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: Marsu42 on September 19, 2013, 12:42:10 PM

Title: Inter-modules framework or code samples?
Post by: Marsu42 on September 19, 2013, 12:42:10 PM
As more features get moved into modules, inter-module connections imho becomes more important as for example ettr using dual_iso's calls with "extern WEAK_FUNC(ret_0) ...". But what if I want to do these things w/o touching the other module:

1. detect if a module is loaded at all?

2. get or set other module's config vars?

Are there existing code samples anywhere? If not, it'd be great if there would be a core framework for these, for example module_check_enabled("ettr") and module_set/get_config("ettr", "auto_ettr", "0").
Title: Re: Inter-modules framework or code samples?
Post by: g3gg0 on September 26, 2013, 11:58:11 PM
nothing implemented like that yet.
feel free to implement it ;)
Title: Re: Inter-modules framework or code samples?
Post by: coutts on September 27, 2013, 03:58:19 AM
Hm good idea.

Sent from my Nexus 7
Title: Re: Inter-modules framework or code samples?
Post by: Marsu42 on September 27, 2013, 08:56:18 PM
Quote from: g3gg0 on September 26, 2013, 11:58:11 PM
feel free to implement it ;)

No way - I tried to pull in "extern module_entry_t module_list" and search through it, but my C coding simply isn't up to the task so one of the devs will have to do it ...

... imho with more modules even now in the pull queue, this is necessary, and btw alex mentioned he's working on something like this when I asked about how to detect and disable ettr from my module.
Title: Re: Inter-modules framework or code samples?
Post by: dmilligan on September 27, 2013, 10:19:44 PM
should be really easy:


int is_module_enabled(char* name)
{
    for(int i = 0; i < MODULE_COUNT_MAX; i++)
    {
        if(streq(name, module_list[i]->name))
            return module_list[i]->enabled;
    }
    return 0;
}