Index: azure_iot_hub_riscv/trunk/asp_baseplatform/gdic/sipeed_st7789/sipeed_st7789.c
===================================================================
--- azure_iot_hub_riscv/trunk/asp_baseplatform/gdic/sipeed_st7789/sipeed_st7789.c	(revision 453)
+++ azure_iot_hub_riscv/trunk/asp_baseplatform/gdic/sipeed_st7789/sipeed_st7789.c	(revision 458)
@@ -83,10 +83,10 @@
 static void set_dcx_control(LCD_Handler_t *hlcd)
 {
-    gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_LOW);
+	gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_LOW);
 }
 
 static void set_dcx_data(LCD_Handler_t *hlcd)
 {
-    gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_HIGH);
+	gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_HIGH);
 }
 
@@ -101,9 +101,9 @@
 
 	aTxBuffer[0] = c;
-    set_dcx_control(hlcd);
+	set_dcx_control(hlcd);
 	hspi->Init.DataSize = 8;
 	hspi->Init.InstLength = 8;
 	hspi->Init.AddrLength = 0;
-    ercd = spi_core_transmit(hspi, hlcd->cs_sel, (uint8_t *)(aTxBuffer), 1);
+	ercd = spi_core_transmit(hspi, hlcd->cs_sel, (uint8_t *)(aTxBuffer), 1);
 #if SPI_WAIT_TIME == 0
 	if(ercd == E_OK)
@@ -128,5 +128,5 @@
 		aTxBuffer[i] = buf[i];
 
-    set_dcx_data(hlcd);
+	set_dcx_data(hlcd);
 	hspi->Init.DataSize = 8;
 	hspi->Init.InstLength = 8;
@@ -146,5 +146,5 @@
 	ER ercd = E_OK;
 
-    set_dcx_data(hlcd);
+	set_dcx_data(hlcd);
 	hspi->Init.DataSize = 8;
 	hspi->Init.InstLength = 8;
@@ -167,5 +167,5 @@
 	ER ercd = E_OK;
 
-    set_dcx_data(hlcd);
+	set_dcx_data(hlcd);
 	hspi->Init.DataSize = 16;
 	hspi->Init.InstLength = 16;
@@ -188,5 +188,5 @@
 	ER ercd = E_OK;
 
-    set_dcx_data(hlcd);
+	set_dcx_data(hlcd);
 	hspi->Init.DataSize = 32;
 	hspi->Init.InstLength = 0;
@@ -206,5 +206,5 @@
 {
 	GPIO_Init_t init = {0};
-    uint8_t data = 0;
+	uint8_t data[2] = {0};
 
 	/*
@@ -214,6 +214,6 @@
 	init.mode = GPIO_MODE_OUTPUT;
 	init.pull = GPIO_PULLDOWN;
-    gpio_setup(TADR_GPIO_BASE, &init, hlcd->dcx_no);
-    gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_HIGH);
+	gpio_setup(TADR_GPIO_BASE, &init, hlcd->dcx_no);
+	gpio_set_pin(TADR_GPIO_BASE, hlcd->dcx_no, PORT_HIGH);
 
 	/*
@@ -227,6 +227,6 @@
 		gpio_set_pin(TADR_GPIO_BASE, hlcd->rst_no, PORT_HIGH);
 
-	    gpio_set_pin(TADR_GPIO_BASE, hlcd->rst_no, 0);
-	    gpio_set_pin(TADR_GPIO_BASE, hlcd->rst_no, 1);
+		gpio_set_pin(TADR_GPIO_BASE, hlcd->rst_no, 0);
+		gpio_set_pin(TADR_GPIO_BASE, hlcd->rst_no, 1);
 	}
 
@@ -245,6 +245,6 @@
 	 */
 	lcd_writecommand(hlcd, PIXEL_FORMAT_SET);
-	data = 0x55;
-    lcd_writebyte(hlcd, &data, 1);
+	data[0] = 0x55;
+	lcd_writebyte(hlcd, &data, 1);
 	if(hlcd->dir & DIR_XY_MASK){
 		hlcd->_width = ST7789_TFTHEIGHT;
@@ -259,5 +259,10 @@
 
 	lcd_writecommand(hlcd, MEMORY_ACCESS_CTL);
-    lcd_writebyte(hlcd, (uint8_t *)&hlcd->dir, 1);
+	lcd_writebyte(hlcd, (uint8_t *)&hlcd->dir, 1);
+
+	//lcd_writecommand(hlcd, RGB_IF_SIGNAL_CTL);
+	//data[0] = 0x00;
+	//data[1] = 0xF8;
+	//lcd_writebyte(hlcd, &data, 2);
 
 	/*
@@ -274,19 +279,19 @@
 lcd_setAddrWindow(LCD_Handler_t *hlcd,  uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
 {
-    uint8_t data[4] = {0};
-
-    data[0] = (uint8_t)(x0 >> 8);
-    data[1] = (uint8_t)(x0);
-    data[2] = (uint8_t)(x1 >> 8);
-    data[3] = (uint8_t)(x1);
+	uint8_t data[4] = {0};
+
+	data[0] = (uint8_t)(x0 >> 8);
+	data[1] = (uint8_t)(x0);
+	data[2] = (uint8_t)(x1 >> 8);
+	data[3] = (uint8_t)(x1);
 	lcd_writecommand(hlcd, HORIZONTAL_ADDRESS_SET);
-    lcd_writebyte(hlcd, data, 4);
-
-    data[0] = (uint8_t)(y0 >> 8);
-    data[1] = (uint8_t)(y0);
-    data[2] = (uint8_t)(y1 >> 8);
-    data[3] = (uint8_t)(y1);
+	lcd_writebyte(hlcd, data, 4);
+
+	data[0] = (uint8_t)(y0 >> 8);
+	data[1] = (uint8_t)(y0);
+	data[2] = (uint8_t)(y1 >> 8);
+	data[3] = (uint8_t)(y1);
 	lcd_writecommand(hlcd, VERTICAL_ADDRESS_SET);
-    lcd_writebyte(hlcd, data, 4);
+	lcd_writebyte(hlcd, data, 4);
 
 	SVC_PERROR(lcd_writecommand(hlcd, MEMORY_WRITE));
@@ -305,5 +310,5 @@
 lcd_fillRect(LCD_Handler_t *hlcd, int16_t x, int16_t y, int16_t w, int16_t h, color_t color)
 {
-    uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
+	uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
 	// rudimentary clipping (drawChar w/big text requires this)
 	if((x >= hlcd->_width) || (y >= hlcd->_height)) return;
@@ -312,5 +317,5 @@
 
 	lcd_setAddrWindow(hlcd, x, y, x+w-1, y+h-1);
-    SVC_PERROR(lcd_filldata(hlcd, &data, (h*w+1)/2));
+	SVC_PERROR(lcd_filldata(hlcd, &data, (h*w+1)/2));
 }
 
@@ -326,5 +331,5 @@
 {
 	uint32_t data = color;
-    lcd_setAddrWindow(hlcd, x, y, x, y);
+	lcd_setAddrWindow(hlcd, x, y, x, y);
 	SVC_PERROR(lcd_writehalf(hlcd, &data, 1));
 }
@@ -341,5 +346,5 @@
 lcd_drawFastVLine(LCD_Handler_t *hlcd, int16_t x, int16_t y, int16_t h, color_t color)
 {
-    uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
+	uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
 	// Rudimentary clipping
 	if(h == 0) return;
@@ -347,5 +352,5 @@
 	if((y+h-1) >= hlcd->_height) h = hlcd->_height-y;
 	lcd_setAddrWindow(hlcd, x, y, x, y+h-1);
-    SVC_PERROR(lcd_filldata(hlcd, &data, (h+1)/2));
+	SVC_PERROR(lcd_filldata(hlcd, &data, (h+1)/2));
 }
 
@@ -360,5 +365,5 @@
 void lcd_drawFastHLine(LCD_Handler_t *hlcd, int16_t x, int16_t y, int16_t w, color_t color)
 {
-    uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
+	uint32_t data = ((uint32_t)color << 16) | (uint32_t)color;
 	// Rudimentary clipping
 	if(w == 0) return;
@@ -366,5 +371,5 @@
 	if((x+w-1) >= hlcd->_width)  w = hlcd->_width-x;
 	lcd_setAddrWindow(hlcd, x, y, x+w-1, y);
-    SVC_PERROR(lcd_filldata(hlcd, &data, (w+1)/2));
+	SVC_PERROR(lcd_filldata(hlcd, &data, (w+1)/2));
 }
 
@@ -462,5 +467,5 @@
 
 	lcd_setAddrWindow(hlcd, x, y, x+width-1, y+height-1);
-    set_dcx_data(hlcd);
+	set_dcx_data(hlcd);
 	hspi->Init.DataSize = 32;
 	hspi->Init.InstLength = 0;
@@ -533,5 +538,5 @@
 {
 	LCD_Handler_t *hlcd = pDrawProp->hlcd;
- 	int32_t   decision;    /* Decision Variable */ 
+	int32_t   decision;    /* Decision Variable */ 
 	uint32_t  current_x;   /* Current X Value */
 	uint32_t  current_y;   /* Current Y Value */
