mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
boards/xtensa/esp32s3/esp32s3-box: Fix ILI9342C color inversion
When using the ILI9342C LCD on the esp32s3-box-3 development board, the displayed colors are inverted. add content Manually converts the byte order of color data from little-endian to big-endian before transmission.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <endian.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
@@ -420,6 +421,11 @@ static int ili9342c_sendgram(struct ili9341_lcd_s *lcd,
|
||||
{
|
||||
struct ili9342c_lcd_dev *priv = (struct ili9342c_lcd_dev *)lcd;
|
||||
|
||||
for (uint32_t i = 0; i < nwords; i++)
|
||||
{
|
||||
((uint16_t *)wd)[i] = swap16(wd[i]);
|
||||
}
|
||||
|
||||
lcdinfo("lcd:%p, wd=%p, nwords=%" PRIu32 "\n", lcd, wd, nwords);
|
||||
|
||||
SPI_SETBITS(priv->spi_dev, 16);
|
||||
|
||||
Reference in New Issue
Block a user