瀏覽代碼

fix: l_pm_last_reson改对(2个返回值)之后,行为反而跟原本不符

Wendal Chen 5 年之前
父節點
當前提交
711a5b71b3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      luat/modules/luat_lib_pm.c

+ 2 - 2
luat/modules/luat_lib_pm.c

@@ -146,8 +146,8 @@ static int l_pm_on(lua_State *L) {
 /**
 开机原因,用于判断是从休眠模块开机,还是电源/复位开机
 @api pm.lastReson()
-@return int 0-普通开机(上电/复位),3-深睡眠开机,4-休眠开机
 @return int 0-上电开机, RTC开机, WakeupIn/Pad开机
+@return int 0-普通开机(上电/复位),3-深睡眠开机,4-休眠开机
 @usage
 -- 是哪种方式开机呢
 log.info("pm", "last power reson", pm.lastReson)
@@ -156,8 +156,8 @@ static int l_pm_last_reson(lua_State *L) {
     int lastState = 0;
     int rtcOrPad = 0;
     luat_pm_last_state(&lastState, &rtcOrPad);
-    lua_pushinteger(L, lastState);
     lua_pushinteger(L, rtcOrPad);
+    lua_pushinteger(L, lastState);
     return 2;
 }