cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F769I-DISCOVERY stm32f769i_discovery_lcd.c

bbcvaltin
Associate
Posted on November 18, 2016 at 16:18

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;

}
2 REPLIES 2
Imen.D
ST Employee
Posted on November 18, 2016 at 17:08

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.forum

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee
Posted on December 21, 2016 at 17:01

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen