Hi, I’ve had a rummage around the reference doco, and these forums, but cannot find an answer, so here’s asking:
Is there an unusually small limit on stack size/depth for Timer callback handlers? I’ve been using four timers and they’ve behaved exactly as expected, but I added a fifth and initially got an immediate stack-overflow, as soon as the timer was called. The timer contained two calls to Log.info() with several simple variables formatted into the output, but nothing else.
Its function was to provide an independent diagnostic output without being in the main event loop (where I was previously using a delay(3000) call to manage the frequency of serial output updates). It’s not a critical part of the code, and I’ve resolved the issue by just getting the timer to set a flag every n-seconds, and testing/resetting the flag in the event loop to print diagnostic output if set.
Mainly, I want to know if there is a limit, and how to find it? I’m more concerned with creating code that is just a smidge below some fatal stack threshold and getting random failures out in the field when the planets align!
I note the ApplicationWatchdog function has a configurable stack, but Timers don’t, and there’s no mention of a limit in this regard.