It's been my understanding that Arduino is single threaded (except for their own interrupt handling) and that single use resources could be handled in your user code (the main loop) anywhere without conflict (multi-use) because you would naturally structure the code to use a resource (and clean up) then use the resource again... If you're doing your own threading model then it would benefit us to understand What you've implemented to split your tasks among many cycles of the main loop. I just googled and it doesn't appear that Arduino has a multi-tasking component of its loop But of course there are many open source extensions to the basis setup.
Are you primarily concerned with common use of the I2C bus? Is you "mutex" just a bit/byte/word of memory that you're in a stream to an external device and need to complete it? Or, does mutex imply you have a supervisor interpreting the availability of a resource and selecting whether or not to "dispatch" a thread (section of code) to execute based on the resource availability? On Thu, Jan 23, 2020 at 5:51 PM Alex via TriEmbed <[email protected]> wrote: > I’m working on a time and weather forecast clock based on an ESP32 and a > 20x4 HD44800 LCD connected via an I2C port expander thing. I’m ‘cheating’ > at the moment by splitting the display update code and the weather-fetch > code into two tasks and pinning them to separate cores. > > I think the right way to do this is to protect the LCD at the > character-sending level with a mutex, but I dread what I may find in terms > of how they have overloaded the usual Arduino print and println functions. > I should probably also replace my global ‘locking’ access to the network > with a mutex, since NTP and the weather updates could clash. > > Anyone already do something similar to this who would like to share code? > > Thanks, > Alex > _______________________________________________ > Triangle, NC Embedded Computing mailing list > > To post message: [email protected] > List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org > TriEmbed web site: http://TriEmbed.org > To unsubscribe, click link and send a blank message: mailto: > [email protected]?subject=unsubscribe > > -- Best regards, Mike
_______________________________________________ Triangle, NC Embedded Computing mailing list To post message: [email protected] List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org TriEmbed web site: http://TriEmbed.org To unsubscribe, click link and send a blank message: mailto:[email protected]?subject=unsubscribe
