its related to using setTimeout within the loop I think
Yes, you're basically just queuing up 27 timeouts even before the function is run. Probably best to just schedule a new timeout at the end of the test function and then call test once...
Is this a bug or feature?
It's neither, but it is intended behaviour. It's a very constrained device and I try hard to ensure you can do things easily that would normally be very difficult.
The palette needs to be in RAM. In the image is not in RAM, the palette has to be loaded separately. The RAM for that palette has to be allocated on the stack all the time regardless of if a palette is used, so if I increase the number of palette entries required that's RAM that gets wasted in all cases apart from when there's an optimal palette.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, you're basically just queuing up 27 timeouts even before the function is run. Probably best to just schedule a new timeout at the end of the
test
function and then calltest
once...It's neither, but it is intended behaviour. It's a very constrained device and I try hard to ensure you can do things easily that would normally be very difficult.
The palette needs to be in RAM. In the image is not in RAM, the palette has to be loaded separately. The RAM for that palette has to be allocated on the stack all the time regardless of if a palette is used, so if I increase the number of palette entries required that's RAM that gets wasted in all cases apart from when there's an optimal palette.