acassis commented on code in PR #8398:
URL: https://github.com/apache/nuttx/pull/8398#discussion_r1093254144
##########
drivers/lcd/st7789.c:
##########
@@ -781,7 +791,7 @@ static int st7789_setcontrast(FAR struct lcd_dev_s *dev,
*
****************************************************************************/
-FAR struct lcd_dev_s *st7789_lcdinitialize(FAR struct spi_dev_s *spi)
+FAR struct lcd_dev_s *st7789_lcdinitialize(FAR struct spi_dev_s *spi, uint8_t
orientation, uint16_t xoff, uint16_t yoff)
Review Comment:
Ditto
##########
drivers/lcd/st7789.c:
##########
@@ -347,32 +354,35 @@ static void st7789_display(FAR struct st7789_dev_s *dev,
bool on)
*
****************************************************************************/
-static void st7789_setorientation(FAR struct st7789_dev_s *dev)
+static void st7789_setorientation(FAR struct st7789_dev_s *dev, uint8_t
orientation)
{
/* No need to change the orientation in PORTRAIT mode */
-#if !defined(CONFIG_LCD_PORTRAIT)
- st7789_sendcmd(dev, ST7789_MADCTL);
- st7789_select(dev->spi, 8);
-
-# if defined(CONFIG_LCD_RLANDSCAPE)
- /* RLANDSCAPE : MY=1 MV=1 */
-
- SPI_SEND(dev->spi, 0xa0);
+ if (orientation != LCD_PORTRAIT)
+ {
+ st7789_sendcmd(dev, ST7789_MADCTL);
+ st7789_select(dev->spi, 8);
+ }
-# elif defined(CONFIG_LCD_LANDSCAPE)
- /* LANDSCAPE : MX=1 MV=1 */
+ if (orientation == LCD_RLANDSCAPE)
+ {
+ /* RLANDSCAPE : MY=1 MV=1 */
- SPI_SEND(dev->spi, 0x70);
+ SPI_SEND(dev->spi, 0xa0);
+ }
+ else if (orientation == LCD_LANDSCAPE)
+ {
+ /* LANDSCAPE : MX=1 MV=1 */
-# elif defined(CONFIG_LCD_RPORTRAIT)
- /* RPORTRAIT : MX=1 MY=1 */
+ SPI_SEND(dev->spi, 0x70);
+ }
+ else if (orientation == LCD_RPORTRAIT)
+ { /* RPORTRAIT : MX=1 MY=1 */
Review Comment:
Move comment to the next line to avoid nxstyle reporting this error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]