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
ee8daad3
Commit
ee8daad3
authored
Dec 29, 2014
by
funshine
Browse files
add rtc time
parent
3e25a105
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/tmr.c
View file @
ee8daad3
...
...
@@ -154,6 +154,16 @@ static int ICACHE_FLASH_ATTR tmr_wdclr( lua_State* L )
return
0
;
}
// Lua: time() , return rtc time in us
static
int
ICACHE_FLASH_ATTR
tmr_time
(
lua_State
*
L
)
{
unsigned
t
=
0xFFFFFFFF
&
system_get_rtc_time
();
unsigned
c
=
0xFFFFFFFF
&
system_rtc_clock_cali_proc
();
lua_pushinteger
(
L
,
t
);
lua_pushinteger
(
L
,
c
);
return
2
;
}
// Module function map
#define MIN_OPT_LEVEL 2
#include "lrodefs.h"
...
...
@@ -164,6 +174,7 @@ const LUA_REG_TYPE tmr_map[] =
{
LSTRKEY
(
"alarm"
),
LFUNCVAL
(
tmr_alarm
)
},
{
LSTRKEY
(
"stop"
),
LFUNCVAL
(
tmr_stop
)
},
{
LSTRKEY
(
"wdclr"
),
LFUNCVAL
(
tmr_wdclr
)
},
{
LSTRKEY
(
"time"
),
LFUNCVAL
(
tmr_time
)
},
#if LUA_OPTIMIZE_MEMORY > 0
#endif
...
...
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