waveshare / IT8951

57 stars 36 forks source link

Memory hungry? #1

Open JorgosCoenen opened 5 years ago

JorgosCoenen commented 5 years ago

Noticed that the library hogs memory when using the BMP-conversion feature. Each screen update added about 1-2% of memory usage until the application would crash.

I added these two lines just before the return in Show_bmp() in miniGUI.c (line 685), which seems to be a big improvement from my initial tests. I also added a call to the IT8951_Cancel() function from IT8951.c in my application, but this doesn't appear to have a big effect.

free(bmp_dst_buf);
free(bmp_src_buf);

Only tested on 9.7" display with RaspberryPi Zero.