AnsweredAssumed Answered

Missing parameter in  LCD_LL_DrawBitmap8bpp

Question asked by ra hummel on Nov 22, 2017
Latest reply on Nov 23, 2017 by Imen D

According to the emWin manual LCD_SetDevFunc can be used to set additional and / or user defined functions of the display driver.

Examples from STM32CubeF4 are using the function within LCDConf_xxxx.c to set a low layer drawing function for 8bpp bitmaps like

LCD_SetDevFunc(i, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))LCD_LL_DrawBitmap8bpp);

to use DMA2D for the data transfer. However the emwin manual says:

LCD_DEVFUNC_DRAWBMP_8BPP
Can be used to set up a function which draws 8bpp palette based bitmaps. This can
make sense if for example a BitBLT engine is available to do the job.
The function pointed by
pDriverFunc should be of the following type:
void DrawBMP8(int LayerIndex,
int x, int y, U8 const * p, int xSize, int ySize,
int BytesPerLine, const LCD_PIXELINDEX * pTrans);

  whereas the passed function pointer in LCDConf_xxxx has the following signature:

static void LCD_LL_DrawBitmap8bpp(int LayerIndex, int x, int y, U8 const * p, int xSize, int ySize, int BytesPerLine)

So the last parameter pTrans is missing. Don't know if this is a problem, but it should be fixed because emWin is passing pTrans anyway.

Outcomes