Inter-modules framework or code samples?

Started by Marsu42, September 19, 2013, 12:42:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

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").

g3gg0

nothing implemented like that yet.
feel free to implement it ;)
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

coutts


Marsu42

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.

dmilligan

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;
}