Skip to main content
bbcvaltin
Visitor II
November 18, 2016
Question

STM32F769I-DISCOVERY stm32f769i_discovery_lcd.c

  • November 18, 2016
  • 2 replies
  • 669 views
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;

}
    This topic has been closed for replies.

    2 replies

    ST Technical Moderator
    November 18, 2016
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    ST Technical Moderator
    December 21, 2016
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks