[TriEmbed] ESP8266 Programming tip

John Vaughters jvaughters04 at yahoo.com
Wed Jan 27 14:33:59 CST 2021


Mike,

>An example might be strcpy.  It's several assembly instructions long.  So when the timer runs out, we don't know the status of that copy.

In the case of an interrupt, this example makes perfect sense. In the case of using millis() or micro() to schedule a turn, this is not clear to me. Maybe I am over-simplifying it and I certainly have not spent the time to review the library code. But if code is moving along, and the scheduled time frame passes to execute but the current action is progress, it would wait for that code to complete before moving to the next step. And so we are not dealing with any sort of context switch at all, just waiting our turn to execute once the program reaches our place in line. Hence my comment that we may be dealing with sequential programming. To me I am left wondering exactly what the Ticker lib does, but not so willing to take that time to figure it out. There are definitely conflicts to my simplified belief. Maybe one day I will investigate further. For sure your input has helped me understand the Watchdogs more.

The new timer arrangement went about a day with zero communication errors and that is an improvement. I even reduced the response timeout to modbus comms and still no issue. that is better than when I was using the delay, which had a 3-5 errors a day with a longer modbus response timeout. That could also just be a fluke in good wifi connections, but it does seem better and the responsiveness of the code certainly was improved by taking out a guaranteed 25ms delay.

I appreciate everyone's efforts in helping explain this ESP product, I learned alot in the past week or so on this little board. I really like it. So cheap relative to the capabilities. I wish I wouldn't have waited this long. `,~)

Thanks,

John Vaughters




More information about the TriEmbed mailing list