Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
16e19442
Commit
16e19442
authored
Sep 28, 2016
by
Johny Mattsson
Browse files
Added node.osprint().
Implemented in terms of esp_log_level_set() at this point.
parent
febc8f7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/modules/node.c
View file @
16e19442
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "task/task.h"
#include "task/task.h"
#include "vfs.h"
#include "vfs.h"
#include "esp_system.h"
#include "esp_system.h"
#include "esp_log.h"
#include "ldebug.h"
#include "ldebug.h"
// Lua: heap()
// Lua: heap()
...
@@ -248,6 +249,16 @@ static int node_task_post( lua_State* L )
...
@@ -248,6 +249,16 @@ static int node_task_post( lua_State* L )
}
}
static
int
node_osprint
(
lua_State
*
L
)
{
if
(
lua_toboolean
(
L
,
1
))
esp_log_level_set
(
"*"
,
CONFIG_LOG_DEFAULT_LEVEL
);
else
esp_log_level_set
(
"*"
,
ESP_LOG_NONE
);
return
0
;
}
static
const
LUA_REG_TYPE
node_egc_map
[]
=
{
static
const
LUA_REG_TYPE
node_egc_map
[]
=
{
{
LSTRKEY
(
"setmode"
),
LFUNCVAL
(
node_egc_setmode
)
},
{
LSTRKEY
(
"setmode"
),
LFUNCVAL
(
node_egc_setmode
)
},
{
LSTRKEY
(
"NOT_ACTIVE"
),
LNUMVAL
(
EGC_NOT_ACTIVE
)
},
{
LSTRKEY
(
"NOT_ACTIVE"
),
LNUMVAL
(
EGC_NOT_ACTIVE
)
},
...
@@ -274,6 +285,7 @@ static const LUA_REG_TYPE node_map[] =
...
@@ -274,6 +285,7 @@ static const LUA_REG_TYPE node_map[] =
{
LSTRKEY
(
"egc"
),
LROVAL
(
node_egc_map
)
},
{
LSTRKEY
(
"egc"
),
LROVAL
(
node_egc_map
)
},
{
LSTRKEY
(
"heap"
),
LFUNCVAL
(
node_heap
)
},
{
LSTRKEY
(
"heap"
),
LFUNCVAL
(
node_heap
)
},
{
LSTRKEY
(
"input"
),
LFUNCVAL
(
node_input
)
},
{
LSTRKEY
(
"input"
),
LFUNCVAL
(
node_input
)
},
{
LSTRKEY
(
"osprint"
),
LFUNCVAL
(
node_osprint
)
},
{
LSTRKEY
(
"restart"
),
LFUNCVAL
(
node_restart
)
},
{
LSTRKEY
(
"restart"
),
LFUNCVAL
(
node_restart
)
},
{
LSTRKEY
(
"stripdebug"
),
LFUNCVAL
(
node_stripdebug
)
},
{
LSTRKEY
(
"stripdebug"
),
LFUNCVAL
(
node_stripdebug
)
},
{
LSTRKEY
(
"task"
),
LROVAL
(
node_task_map
)
},
{
LSTRKEY
(
"task"
),
LROVAL
(
node_task_map
)
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment