Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By frankDownunder
#38761 Delay(xx) seems to cause a reset. Either that, or taking too long causes a reset.
A related (non-sming related) topic viewtopic.php?f=28&t=6379 didnt get a good answer.
So I have been looking at the example Adafruit_SSD1306, to display stuff on an OLED screen at
~/Sming/Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino
Naively I thought that to be published under the examples folder meant that the code would work with sming. I copied and pasted slabs into my Eclipse project then wondered why it reset so much. The tests coded in the setup function take a long time to run with at least 15 two second pauses between each screen test. I split the tests up into lots of small tests and ran them one after each other and it works better, using a timer:
procTimer.initializeMs(5000, displayTest).start();
I find that the more work I do in one of those tests, the more likely it is to fail. Specifically lots of calls to delay() will cause grief. Wifi is enabled if that matters.

Ive done a bit of research but I cant get find a definitive answer -
Is delay a bad thing? Should we avoid it like the plague?
Does it yield and let other stuff run at all ?
Is the sming version of delay different to the Arduino version?
How much time do we have before the chip decides we have taken too long and pulls the rug out from under our feet?
Is there some way to ask for more time?