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
1ce5deff
Commit
1ce5deff
authored
Apr 12, 2015
by
zeroday
Browse files
Merge pull request #349 from klukonin/patch-3
Update tmr.c
parents
7c759a61
f19e24c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/tmr.c
View file @
1ce5deff
...
@@ -71,6 +71,12 @@ static int tmr_delay( lua_State* L )
...
@@ -71,6 +71,12 @@ static int tmr_delay( lua_State* L )
us
=
luaL_checkinteger
(
L
,
1
);
us
=
luaL_checkinteger
(
L
,
1
);
if
(
us
<=
0
)
if
(
us
<=
0
)
return
luaL_error
(
L
,
"wrong arg range"
);
return
luaL_error
(
L
,
"wrong arg range"
);
if
(
us
<
1000000
)
{
os_delay_us
(
us
);
WRITE_PERI_REG
(
0x60000914
,
0x73
);
return
0
;
}
unsigned
sec
=
(
unsigned
)
us
/
1000000
;
unsigned
sec
=
(
unsigned
)
us
/
1000000
;
unsigned
remain
=
(
unsigned
)
us
%
1000000
;
unsigned
remain
=
(
unsigned
)
us
%
1000000
;
int
i
=
0
;
int
i
=
0
;
...
...
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