Просмотр исходного кода

update:旋转方向改为枚举

Dozingfiretruck 1 год назад
Родитель
Сommit
8287f5dad3
2 измененных файлов с 11 добавлено и 4 удалено
  1. 7 0
      components/lcd/luat_lcd.h
  2. 4 4
      components/lcd/luat_lib_lcd.c

+ 7 - 0
components/lcd/luat_lcd.h

@@ -27,6 +27,13 @@
 #error "no support color depth"
 #endif
 
+enum{
+    LUAT_LCD_ROTATE_0 = 0,
+    LUAT_LCD_ROTATE_90,
+    LUAT_LCD_ROTATE_180,
+    LUAT_LCD_ROTATE_270,
+};
+
 enum{
 	LUAT_LCD_HW_ID_0    = 0x20,	//专用LCD接口 ID
 

+ 4 - 4
components/lcd/luat_lib_lcd.c

@@ -1981,13 +1981,13 @@ static const rotable_Reg_t reg_lcd[] =
 #endif
     { "set_direction",  ROREG_FUNC(l_lcd_set_direction)},
     //@const direction_0 int 0°方向命令
-    { "direction_0",    ROREG_INT(0)},
+    { "direction_0",    ROREG_INT(LUAT_LCD_ROTATE_0)},
     //@const direction_90 int 90°方向命令
-    { "direction_90",   ROREG_INT(1)},
+    { "direction_90",   ROREG_INT(LUAT_LCD_ROTATE_90)},
     //@const direction_180 int 180°方向命令
-    { "direction_180",  ROREG_INT(2)},
+    { "direction_180",  ROREG_INT(LUAT_LCD_ROTATE_180)},
     //@const direction_270 int 270°方向命令
-    { "direction_270",  ROREG_INT(3)},
+    { "direction_270",  ROREG_INT(LUAT_LCD_ROTATE_270)},
     //@const SPI 硬件spi device lcd驱动
     { "SPI",            ROREG_INT(LUAT_LCD_SPI_DEVICE)},
     //@const HWID_0 硬件lcd驱动id0 (根据芯片支持选择)