Pete, I just caught my clock taking a pause in the display update, presumably while it fetched a weather update. Somewhere there’s a library using a delay() or in a blocking loop which is blocking my display thread, despite pinning.
Grrrr. > On Jan 24, 2020, at 8:33 AM, Mike Lisanke <[email protected]> wrote: > > Ok, thanks for the clarification. > > On Fri, Jan 24, 2020 at 7:57 AM <[email protected] > <mailto:[email protected]>> wrote: > On ESP boards in Arduino you get freeRTOS built-in (no need to include > anything). I guess this is because the Espresstif libraries include it. > > I’m mainly concerned with the scheduler not interrupting the character > sending process for the HD44800 LCD. So far it seems a 'vTaskDelay(1);’ in > each thread has things working well. Mutex would usually be to lock a shared > resource but I was considering it just as way to stop other threads while the > LCD is written. > > Alex > >> On Jan 24, 2020, at 7:43 AM, Mike Lisanke <[email protected] >> <mailto:[email protected]>> wrote: >> >> 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] >> <mailto:[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] <mailto:[email protected]> >> List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org >> <http://mail.triembed.org/mailman/listinfo/triembed_triembed.org> >> TriEmbed web site: http://TriEmbed.org <http://triembed.org/> >> To unsubscribe, click link and send a blank message: >> mailto:[email protected] >> <mailto:[email protected]>?subject=unsubscribe >> >> >> >> -- >> Best regards, Mike > > > > -- > 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
