2016-11-18 07:18 AM
uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
{ uint32_t ret = 0; if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) { /* Read data value from SDRAM memory */ ret = *(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (2
*(Ypos*BSP_LCD_GetXSize() + Xpos))); //FBStartAdress=0xC0000000; } else if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888) { /* Read data value from SDRAM memory */ ret = (*(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (2
*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF); }...................................................... return ret;}In my opinion it should be as follows:uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos){ uint32_t ret = 0; if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) { /* Read data value from SDRAM memory */ ret = *(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (4
*(Ypos*BSP_LCD_GetXSize() + Xpos))); //FBStartAdress=0xC0000000; } else if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888) { /* Read data value from SDRAM memory */ ret = (*(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (4
*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF); }...................................................... return ret;}2016-11-18 08:08 AM
Dear User,
Thanks for highlighting this issue. Your feedback is reported internally for checking and we will get back to you soon with update on this. Thank you for your understanding. Best Regards STM32.forum2016-12-21 08:01 AM
Dear
‌I checked and confirmed this issue. This bug will be fixed in the coming releases.
I want to thank you for bringing this issue to our attention.
All your feedback are welcome.
Best Regards
Imen