You could open a specific topic into the contributions forum if you want.
Giovanni
Strange impact of CH_DBG options
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Strange impact of CH_DBG options
Wow! great work!
Am I correct in that it won't work for sensors on say PA2, PB2, PB3, because those share the same EXT interrupt line?
Is the EXT module initialized when a conversion starts? (i.e. I could have sensors on those pins, but just the conversions can't be active at the same time) or when the DHT driver is initialized?
In my code, the program doesn't know at compile time when/if/howmany DHT sensors will be connected. So either I should have an array of DHT_t type structures, or I should have one and reuse that, right? What do you recommend?
Am I correct in that it won't work for sensors on say PA2, PB2, PB3, because those share the same EXT interrupt line?
Is the EXT module initialized when a conversion starts? (i.e. I could have sensors on those pins, but just the conversions can't be active at the same time) or when the DHT driver is initialized?
In my code, the program doesn't know at compile time when/if/howmany DHT sensors will be connected. So either I should have an array of DHT_t type structures, or I should have one and reuse that, right? What do you recommend?
Re: Strange impact of CH_DBG options
rew wrote:Am I correct in that it won't work for sensors on say PA2, PB2, PB3, because those share the same EXT interrupt line?
Yes, you are right.
rew wrote:Is the EXT module initialized when a conversion starts? (i.e. I could have sensors on those pins, but just the conversions can't be active at the same time) or when the DHT driver is initialized?
Yes, I completely forgot to tell about it. Thank you.
EXT driver should be enabled in configs and started somewhere before DHT, but all channels could be disabled.
Code: Select all
EXTConfig static extcfg = {};
extStart(&EXTD1, &extcfg);DHT will activate necessary channels itself.
rew wrote:In my code, the program doesn't know at compile time when/if/howmany DHT sensors will be connected. So either I should have an array of DHT_t type structures, or I should have one and reuse that, right? What do you recommend?
If you are not limited in memory then you can use array, that way will be much faster (no need to reinialise DHT on every measurement). If it is more important to save memory - then you can use one, but you'll have to reinitialise it before swapping to other sensor. I don't sure that it will work (I did not concider this scenario), maybe it will require some additional checks in dht11Init, because now there is no function dht11Stop for correct deinitialisation. I'll think about adding it.
BTW, if you'll try that driver, please write your experience and what MCU and sensors you tried. If everything will work OK then I'll think about creating separate topic or add this driver to some of repositories here on forum.
Re: Strange impact of CH_DBG options
I'm still on chibios 2.6.6. So after integrating everything into my source, I notice your driver was for 3.0. A few quick defines get it along the way.... but eventually I encounter things that are hard-to-solve for me:
I'm afraid testing this will have to wait until I've ported my project to 3.0.../ChibiOS_2.6.6/os/kernel/include/chschd.h:144:11: note: expected 'struct Thread *' but argument is of type 'struct Thread ***'