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
76ff5412
Commit
76ff5412
authored
Mar 11, 2016
by
TerryE
Browse files
Prevent UART input race without extra lua_started flag
parent
cf05c9cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/lua/lua.c
View file @
76ff5412
...
...
@@ -468,7 +468,7 @@ int lua_main (int argc, char **argv) {
void
lua_handle_input
(
bool
force
)
{
if
(
force
||
readline
(
&
gLoad
))
if
(
gLoad
.
L
&&
(
force
||
readline
(
&
gLoad
))
)
dojob
(
&
gLoad
);
}
...
...
app/user/user_main.c
View file @
76ff5412
...
...
@@ -80,19 +80,16 @@ void TEXT_SECTION_ATTR user_start_trampoline (void)
call_user_start
();
}
static
bool
lua_started
=
false
;
// +================== New task interface ==================+
static
void
start_lua
(
task_param_t
param
,
uint8
priority
)
{
char
*
lua_argv
[]
=
{
(
char
*
)
"lua"
,
(
char
*
)
"-i"
,
NULL
};
NODE_DBG
(
"Task task_lua started.
\n
"
);
lua_main
(
2
,
lua_argv
);
lua_started
=
true
;
}
static
void
handle_input
(
task_param_t
flag
,
uint8
priority
)
{
// c_printf("HANDLE_INPUT: %u %u\n", flag, priority); REMOVE
if
(
lua_started
)
lua_handle_input
(
flag
);
lua_handle_input
(
flag
);
}
static
task_handle_t
input_sig
;
...
...
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