Skip to content

Commit

Permalink
fix: 64bit固件下, mobile.simid设置识别的问题
Browse files Browse the repository at this point in the history
原因在于, 64bit的LuaNumber的函数返回值直接当参数传入目标函数时,会出现截断错误, 应该是ec618/ec7xx的芯片问题, 使用局部变量中转一次, 就ok了

https://gitee.com/openLuat/LuatOS/issues/I96WCW
  • Loading branch information
wendal committed Apr 22, 2024
1 parent 4ab1dee commit 91df3e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/mobile/luat_lib_mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ static int l_mobile_simid(lua_State* L) {
int ret = 0;
int id = 0;
if (lua_isinteger(L, 1)) {
ret = luat_mobile_set_sim_id(lua_tointeger(L, 1));
LLOGI("sim set to %d , ret %d", lua_tointeger(L, 1), ret);
id = luaL_checkinteger(L, 1);
ret = luat_mobile_set_sim_id(id);
LLOGI("sim set to %d , ret %d", id, ret);
}
if (LUA_TBOOLEAN == lua_type(L, 2)) {
if (lua_toboolean(L, 2)) {
Expand Down

0 comments on commit 91df3e5

Please sign in to comment.