Explorar o código

fix:pm.ioVol第一个参数获取错误

alienwalker %!s(int64=2) %!d(string=hai) anos
pai
achega
b5fc642b5a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      luat/modules/luat_lib_pm.c

+ 1 - 1
luat/modules/luat_lib_pm.c

@@ -333,7 +333,7 @@ IO高电平电压控制,当前仅EC618系列可用
 */
 static int l_pm_iovolt_ctrl(lua_State *L) {
 int val = 3300;
- int id = luaL_checkinteger(L, LUAT_PM_ALL_GPIO);
+ int id = luaL_optinteger(L, 1, LUAT_PM_ALL_GPIO);
  if (lua_isboolean(L, 2)) {
 	val = lua_toboolean(L, 2);
  }