Prechádzať zdrojové kódy

del:luat_i2c_setup接口废弃slaveaddr参数

Dozingfiretruck 3 rokov pred
rodič
commit
8adc0bc249
2 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 1 1
      luat/include/luat_i2c.h
  2. 1 1
      luat/modules/luat_lib_i2c.c

+ 1 - 1
luat/include/luat_i2c.h

@@ -4,7 +4,7 @@
 #include "luat_base.h"
 
 int luat_i2c_exist(int id);
-int luat_i2c_setup(int id, int speed, int slaveaddr);
+int luat_i2c_setup(int id, int speed);
 int luat_i2c_close(int id);
 int luat_i2c_send(int id, int addr, void* buff, size_t len, uint8_t stop);
 int luat_i2c_recv(int id, int addr, void* buff, size_t len);

+ 1 - 1
luat/modules/luat_lib_i2c.c

@@ -209,7 +209,7 @@ end
 */
 static int l_i2c_setup(lua_State *L)
 {
-    int re = luat_i2c_setup(luaL_checkinteger(L, 1), luaL_optinteger(L, 2, 0), luaL_optinteger(L, 3, 0));
+    int re = luat_i2c_setup(luaL_checkinteger(L, 1), luaL_optinteger(L, 2, 0));
     lua_pushinteger(L, re == 0 ? luaL_optinteger(L, 2, 0) : -1);
     return 1;
 }