Bläddra i källkod

add: pm库添加force和check方法

Wendal Chen 5 år sedan
förälder
incheckning
3c37f536cc

+ 5 - 0
luat/include/luat_pm.h

@@ -19,3 +19,8 @@ int luat_pm_dtimer_stop(int id);
 void luat_pm_cb(int event, int arg, void* args);
 
 int luat_pm_last_state(void);
+
+int luat_pm_force(int mode);
+
+int luat_pm_check(void);
+

+ 6 - 0
luat/modules/luat_lib_adc.c

@@ -1,4 +1,10 @@
 
+/*
+@module  adc
+@summary 数模转换
+@version 1.0
+@data    2020.07.03
+*/
 #include "luat_base.h"
 #include "luat_adc.h"
 

+ 6 - 0
luat/modules/luat_lib_crypto.c

@@ -1,4 +1,10 @@
 
+/*
+@module  crypto
+@summary 加解密和hash函数
+@version 1.0
+@data    2020.07.03
+*/
 #include "luat_base.h"
 #include "luat_crypto.h"
 

+ 3 - 3
luat/modules/luat_lib_libcoap.c

@@ -1,8 +1,8 @@
 /*
-@module  socket
-@summary socket操作库
+@module  libcoap
+@summary coap数据处理
 @version 1.0
-@data    2020.03.30
+@data    2020.06.30
 */
 #include "luat_base.h"
 #include "luat_timer.h"

+ 6 - 0
luat/modules/luat_lib_libgnss.c

@@ -1,4 +1,10 @@
 
+/*
+@module  libgnss
+@summary NMEA数据处理
+@version 1.0
+@data    2020.07.03
+*/
 #include "luat_base.h"
 #include "luat_msgbus.h"
 #include "luat_malloc.h"

+ 6 - 1
luat/modules/luat_lib_mqttcore.c

@@ -1,4 +1,9 @@
-
+/*
+@module  libmqtt
+@summary mqtt协议处理
+@version 1.0
+@data    2020.07.03
+*/
 #include "luat_base.h"
 #include "luat_log.h"
 #include "luat_sys.h"

+ 18 - 0
luat/modules/luat_lib_pm.c

@@ -1,4 +1,10 @@
 
+/*
+@module  pm
+@summary 电源管理
+@version 1.0
+@data    2020.07.02
+*/
 #include "lua.h"
 #include "lauxlib.h"
 #include "luat_base.h"
@@ -61,6 +67,16 @@ static int l_pm_last_reson(lua_State *L) {
     return 1;
 }
 
+static int l_pm_force(lua_State *L) {
+    lua_pushinteger(L, luat_pm_force(luaL_checkinteger(L, 1)));
+    return 1;
+}
+
+static int l_pm_check(lua_State *L) {
+    lua_pushinteger(L, luat_pm_check());
+    return 1;
+}
+
 static int luat_pm_msg_handler(lua_State *L, void* ptr) {
     rtos_msg_t* msg = (rtos_msg_t*)lua_topointer(L, -1);
     if (lua_event_cb == 0) {
@@ -94,6 +110,8 @@ static const rotable_Reg reg_pm[] =
     { "dtimerStart",    l_pm_dtimer_start,0},
     { "dtimerStop" ,    l_pm_dtimer_stop, 0},
     { "on",             l_pm_on,   0},
+    { "force",          l_pm_force, 0},
+    { "check",          l_pm_check, 0},
     { "lastReson",      l_pm_last_reson, 0},
     { "IDLE",           NULL, LUAT_PM_SLEEP_MODE_IDLE},
     { "LIGHT",          NULL, LUAT_PM_SLEEP_MODE_LIGHT},

+ 6 - 1
luat/modules/luat_lib_pwm.c

@@ -1,4 +1,9 @@
-
+/*
+@module  pwm
+@summary PWM模块
+@version 1.0
+@data    2020.07.03
+*/
 #include "luat_base.h"
 #include "luat_pwm.h"