martnak / STM32-ILI9341

Simple HAL driver for ILI9341 320x240 TFT LCD with Touchscreen for STM32 microcontrollers
MIT License
195 stars 85 forks source link

Buffer_Size in ILI9341_Draw_Colour_Burst() should be fixed #8

Open bluenlive opened 4 years ago

bluenlive commented 4 years ago

Thank you for your great work!

BTW, I think following line should be fixed Buffer_Size = Size; to Buffer_Size = Size * 2;

It also causes that ILI9341_Draw_Char() works not properly. When Size > 1 drawn character seems not clean.

https://github.com/martnak/STM32-ILI9341/blob/2ed24b6fbbd080bb79a21d21ba395926898ce31a/Src/ILI9341/ILI9341_STM32_Driver.c#L354

drzacek commented 2 years ago

Changing the buffer_size in ILI9341_Draw_Colour_Burst() to Size * 2 was the solution!

I was getting weird effects when trying to use vertical lines, they changed color mid way.

ChrisPVille commented 2 years ago

This is most definitely a bug causing stack corruption when the requested Size < BURST_MAX_SIZE and odd (look at the for loop immediately after). The fix above worked for me as well.