Browse Source

[bsp][stm32f429-disco] support ANSI C.

aozima 6 years ago
parent
commit
a3b4e78527
2 changed files with 6 additions and 3 deletions
  1. 2 2
      bsp/stm32f429-disco/drivers/drv_lcd.c
  2. 4 1
      bsp/stm32f429-disco/drivers/drv_touch.c

+ 2 - 2
bsp/stm32f429-disco/drivers/drv_lcd.c

@@ -919,8 +919,6 @@ FINSH_FUNCTION_EXPORT(lcd_blit_line, draw blit line in lcd display);
 
 static int rt_hw_lcd_init(void)
 {
-	_lcd_low_level_init();
-
 	static struct rt_device lcd_device;
 
 	static struct rt_device_graphic_ops ili9341_ops =
@@ -932,6 +930,8 @@ static int rt_hw_lcd_init(void)
 		ili9341_lcd_blit_line
 	};
 
+	_lcd_low_level_init();
+	
 	/* register lcd device */
 	lcd_device.type = RT_Device_Class_Graphic;
 	lcd_device.init = lcd_init;

+ 4 - 1
bsp/stm32f429-disco/drivers/drv_touch.c

@@ -67,7 +67,10 @@ static int32_t touch_read (uint8_t reg, uint8_t *val)
 static int32_t touch_write(uint8_t reg, uint8_t val)
 {
     struct rt_i2c_msg msgs;
-    rt_uint8_t buf[2] = {reg, val};
+    rt_uint8_t buf[2];
+
+    buf[0] = reg;
+    buf[1] = val;
 
     msgs.addr  = TSC_I2C_ADDR;
     msgs.flags = RT_I2C_WR;