Skip to content

Commit

Permalink
fix:spi数据发送长度异常
Browse files Browse the repository at this point in the history
  • Loading branch information
Dozingfiretruck committed Jun 24, 2024
1 parent 18083e6 commit dea3337
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions luat/modules/luat_lib_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ static int l_spi_device_transfer(lua_State *L) {
LLOGE("spi_device transfer first arg error");
return 0;
}
size_t length = luaL_optinteger(L,3,1);
if(length <= send_length)
send_length = length;
if (lua_isinteger(L, 3)){
send_length = (size_t)lua_tointeger(L, 3);
}
size_t recv_length = luaL_optinteger(L,4,1);
//长度为0时,直接返回空字符串
if(recv_length == 0){
Expand Down

0 comments on commit dea3337

Please sign in to comment.