2019-09-30 02:36 AM
I want to create bitmap dynamically. I called bmpId = Bitmap::dynamicBitmapCreate(800, 480, Bitmap::RGB565); I found bmpId is 0xffff.
and then call Bitmap::cacheGetAddress(bmpId);
system will dead loop in Bitmap::cacheGetAddress(bmpId);
2019-09-30 04:06 AM
Hi @DJin.3,
You haven't defined a bitmap cache in touchgfx_generic_init() - Without it, you'll get 0xFFFF as your BitmapID (Could not allocate).
/Martin
2019-09-30 05:19 AM
uint32_t cache[/*size in words*/];
void touchgfx_init()
{
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)cache, sizeof(cache), 1 /*nr of images*/);
...
}
2019-10-01 06:31 PM
Thanks for your reply.
But in my code
/* SRE 25/07/2019 Add define to enable or disable TouchScreen */
/* Touchscreen will impact overall performances as it's scanned by Corelib every X frame hal.setTouchSampleRate(X) */
/* Update init to pass parameter related to dynamic Bitmap */
#ifdef NOTOUCH
HAL& hal = touchgfx_generic_init<STA1095HAL_EVB>(dma, display, tcnotouch, dispWidth, dispHeight, bitmapCache , bitmapcache_size , nbcachedbitmap);
printf("touchgfx HAL Init TouchScreen Disabled \r\n");
#else
HAL& hal = touchgfx_generic_init<STA1095HAL_EVB>(dma, display, tc, dispWidth, dispHeight, bitmapCache, bitmapcache_size, nbcachedbitmap);
//uint8_t* canvasBuffer = NULL;
hal.setTouchSampleRate(2);
hal.setFingerSize(1);
printf("touchgfx HAL Init TouchScreen Enabled : Sample rate every 2 frames \r\n");
#endif
It already declare the cache.
2019-10-01 11:57 PM
Is the cache large enough? I can't really tell from your code - Neither in your init of touchgfx nor where you try to allocate a new dynamic bitmap (it depends on the size and the type).
/Martin