Prechádzať zdrojové kódy

update:开放LUAT_GPIO_PIN_MAX宏

Dozingfiretruck 2 rokov pred
rodič
commit
9a9b7c897d
2 zmenil súbory, kde vykonal 6 pridanie a 5 odobranie
  1. 6 0
      luat/include/luat_gpio.h
  2. 0 5
      luat/modules/luat_lib_gpio.c

+ 6 - 0
luat/include/luat_gpio.h

@@ -6,6 +6,11 @@
 #include "luat_base.h"
 #include "luat_gpio_legacy.h"
 
+// 若bsp没有定义最大PIN编号, 那么默认给个128吧
+#ifndef LUAT_GPIO_PIN_MAX
+#define LUAT_GPIO_PIN_MAX   (128)
+#endif
+
 /**
  * @defgroup luatos_device_gpio GPIO接口
  * @{
@@ -31,6 +36,7 @@
 
 #define LUAT_GPIO_MAX_ID             (Luat_GPIO_MAX_ID) ///< 最大GPIO序号
 
+//无效的GPIO,用作某些函数引脚不指定时使用
 #define LUAT_GPIO_NONE                 (0xff)
 
 /**

+ 0 - 5
luat/modules/luat_lib_gpio.c

@@ -22,11 +22,6 @@
 #define LUAT_LOG_TAG "gpio"
 #include "luat_log.h"
 
-// 若bsp没有定义最大PIN编号, 那么默认给个128吧
-#ifndef LUAT_GPIO_PIN_MAX
-#define LUAT_GPIO_PIN_MAX (128)
-#endif
-
 static int l_gpio_set(lua_State *L);
 static int l_gpio_get(lua_State *L);
 static int l_gpio_close(lua_State *L);