tuupola / hagl

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

Fix image.h guard #113

Closed supcik closed 1 year ago

supcik commented 1 year 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 1 year ago

Good catch. Thanks!

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

With ESP32?

supcik commented 1 year 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 1 year ago

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

image

supcik commented 1 year 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.