Enable EXT from multiple places?
Posted: Wed Jun 03, 2015 9:29 pm
I have an application (running on an stm32f103) with a fairly large codebase -- for modularity, portability, and readability I've split it into several 'modules,' each which lives within its own file and has its own initialization routines. I have several different pins I want to monitor for changes with the EXT driver, and some of these are in different modules. There seems to be no way to cleanly do this, since any call to extStart() will affect ALL the channels. So the options are:
Mostly, I'm just verifying that I do indeed have this correct. It also seems like this kind of functionality could be baked into the EXT driver -- specifically, the ability to modify the configuration on a per-channel basis after extStart() has been called. Is there a reason why this hasn't been done? I ask more for curiousity's sake than anything else.
Thanks!
- - Do the EXT initialization in main, separately from any module. I don't like this option because it puts extra requirements on each module, and makes it harder to port the code
- Do the EXT initialization for all modules in a single one's initialization routine. Similarly non-ideal because it introduces inter-module requirements
- Write an EXT wrapper which maintains a local copy of the config which can be modified by multiple modules. This is probably what I'll end up doing
Mostly, I'm just verifying that I do indeed have this correct. It also seems like this kind of functionality could be baked into the EXT driver -- specifically, the ability to modify the configuration on a per-channel basis after extStart() has been called. Is there a reason why this hasn't been done? I ask more for curiousity's sake than anything else.
Thanks!