Also use 100% static defined for everything. In MCUs RAM errors should be found at compile-time, not when strange things happen because you ran out of RAM.
Do you have a link to where you develop your code? I'd like to have a peek!
Moderators: RoccoMarco, lbednarz, tfAteba
This is because it makes things happen "behind the scenes"."For example I do not make the driver initialize the EXTConfig, I leave this to the user.
Instead there is a generic "ext"-callback that shall be used for sensor interrupts."
don't get this, even looking at code. i would like to hide EXTConfig to user, just tell me with pin the interrupt use
Lets not be hasty here"Also I added so, if it is important, that the rounding errors in the polled time does not accumul'ate over time."
if sensor is in free-running mode. rounding error is 1 clock cicle, so loosing a read every minute is not a great problem.
if it is in sigle read, the error is less bigger as the next reading start after the read
On the "one thread"-part, of course it will be one thread - why should it not be one thread? The only reason you'd might need more threads is if the sensors are on different buses, but then we get into a whole new level of problem.i like the idea of having a queue of more readings, and it is nice that priority sensor are put to the head, but they all end up to ONE dispachte thread, and this is bad for parallelization; only the final data readed should be sincronized to one thread.
Also like a lot the idea of injecting sensor read; but imho should use something like the interrupt handler (or iterrupt handler and poller handler call the inject, with is more a dispachet to the right thread's queue)
Each to his tastealso virtual timer should be translated to only one tread with poll the next reading, as i "fell" it lighter than multiple virtual timer.
Of course you can create a circular buffer, but I really like the queue system. Again, each to his tasteQueue can be a circular array instead of a list, and you just move the ntex of head and tail, so even here you have a static initialization and if that index are just byte (volatile) i think you don't even need READ lock, just a way to get the next (or head) index to write.
i've to think a lot, my head is sping around many ideas and i've to find plausible, and maybe also do some test (well think about how do some test) to measure the ovehead of the system.
On the "one thread"-part, of course it will be one thread - why should it not be one thread? The only reason you'd might need more threads is if the sensors are on different buses, but then we get into a whole new level of problem.