2020-09-13 11:51 PM
I am working on a project with TouchGFX on STM32H7 with 240x320 RGB Display. Framebuffer is in internal RAM.
I calculated the RGB565 framebuffer size to 240x320x2 bytes and allocated this amount in the linker file with "TouchGFX_Framebuffer" atttribute.
So far everything works fine, but I found a source line in TouchGFXGeneratedHAL.cpp, that makes me wonder:
uint32_t frameBuf[(240 * 320 * 2 + 3) / 4] LOCATION_ATTRIBUTE("TouchGFX_Framebuffer");
What ist +3 used for?
Do I have to allocate 3 more bytes?
2020-09-14 12:01 AM
ok, got it.
I think it is to prevent rounding errors (with integers ?!?)
The /4 will leave it with no effect.