From a6f5be1013d98a1e4f6398e149f435c62b57cd05 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Apr 2015 10:16:30 -0600 Subject: [PATCH] ILI9488: Correct some data width issues. Now the ILI9488 driver works fine. --- configs/samv71-xult/src/sam_ili9488.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configs/samv71-xult/src/sam_ili9488.c b/configs/samv71-xult/src/sam_ili9488.c index 68d8d394aee..734b9794b14 100644 --- a/configs/samv71-xult/src/sam_ili9488.c +++ b/configs/samv71-xult/src/sam_ili9488.c @@ -670,7 +670,7 @@ static int sam_setwindow(FAR struct sam_dev_s *priv, sam_color_t row, sam_color_t col, sam_color_t width, sam_color_t height) { - uint8_t buffer[4]; + uint16_t buffer[4]; int ret; lcdvdbg("row=%d col=%d width=%d height=%d\n", row, col, width, height); @@ -681,7 +681,8 @@ static int sam_setwindow(FAR struct sam_dev_s *priv, sam_color_t row, buffer[1] = col & 0xff; buffer[2] = ((col + width - 1) >> 8) & 0xff; buffer[3] = (col + width - 1) & 0xff; - ret = sam_lcd_put(priv, ILI9488_CMD_COLUMN_ADDRESS_SET, (FAR uint16_t*)buffer, 4); + ret = sam_lcd_put(priv, ILI9488_CMD_COLUMN_ADDRESS_SET, buffer, + 4 * sizeof(uint16_t)); if (ret < 0) { return ret; @@ -699,7 +700,8 @@ static int sam_setwindow(FAR struct sam_dev_s *priv, sam_color_t row, buffer[1] = row & 0xff; buffer[2] = ((row + height - 1) >> 8) & 0xff; buffer[3] = (row + height - 1) & 0xff; - ret = sam_lcd_put(priv, ILI9488_CMD_PAGE_ADDRESS_SET, (FAR uint16_t*)buffer, 4); + ret = sam_lcd_put(priv, ILI9488_CMD_PAGE_ADDRESS_SET, buffer, + 4 * sizeof(uint16_t)); if (ret < 0) { return ret;