tuupola / hagl

Hardware Agnostic Graphics Library for embedded
https://www.appelsiini.net/tags/hagl/
MIT License
293 stars 47 forks source link

Fix image.h guard #113

Closed supcik closed 11 months ago

supcik commented 11 months ago

The image.h file has the same guard as pixel.h, so image.h does not get included.

Note : I also had to increase the stack size to use the function hagl_load_image. Perhaps a note in the documentation could be useful.

tuupola commented 11 months ago

Good catch. Thanks!

Note : I also had to increase the stack size to use the function hagl_load_image

With ESP32?

supcik commented 11 months ago

With ESP32?

Yes, with ESP32 and ESP/IDF version 4.4.5. I just tried in the app_main function and the default stack size seems to be 3.5KB. Increasing the stack size to 8KB solved the problem. I did not try to find the minimum stack size, but I can investigate it if you want.

supcik commented 11 months ago

The work local variable is already taking more than 3KB :

image

supcik commented 11 months ago

I guess that the code is anyhow not thread safe, so you could solve this issue by defining the work array as static. It will then no longer take place on the stack.