Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
93c76d2b
Commit
93c76d2b
authored
Sep 29, 2016
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zephyr: Add Ctrl+C handling.
parent
1b76f88e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
1 deletion
+4
-1
zephyr/Makefile
zephyr/Makefile
+1
-0
zephyr/main.c
zephyr/main.c
+2
-0
zephyr/mpconfigport.h
zephyr/mpconfigport.h
+1
-0
zephyr/mphalport.h
zephyr/mphalport.h
+0
-1
No files found.
zephyr/Makefile
View file @
93c76d2b
...
...
@@ -37,6 +37,7 @@ SRC_C = main.c \
lib/utils/stdout_helpers.c
\
lib/utils/printf.c
\
lib/utils/pyexec.c
\
lib/utils/interrupt_char.c
\
lib/mp-readline/readline.c
\
$(BUILD)
/frozen.c
\
$(SRC_MOD)
...
...
zephyr/main.c
View file @
93c76d2b
...
...
@@ -9,6 +9,7 @@
#include "py/gc.h"
#include "py/stackctrl.h"
#include "lib/utils/pyexec.h"
#include "lib/mp-readline/readline.h"
void
do_str
(
const
char
*
src
,
mp_parse_input_kind_t
input_kind
)
{
mp_lexer_t
*
lex
=
mp_lexer_new_from_str_len
(
MP_QSTR__lt_stdin_gt_
,
src
,
strlen
(
src
),
0
);
...
...
@@ -44,6 +45,7 @@ int real_main(void) {
gc_init
(
heap
,
heap
+
sizeof
(
heap
));
#endif
mp_init
();
MP_STATE_PORT
(
mp_kbd_exception
)
=
mp_obj_new_exception
(
&
mp_type_KeyboardInterrupt
);
pyexec_frozen_module
(
"main.py"
);
#if MICROPY_REPL_EVENT_DRIVEN
pyexec_event_repl_init
();
...
...
zephyr/mpconfigport.h
View file @
93c76d2b
...
...
@@ -46,6 +46,7 @@ typedef long mp_off_t;
#define MP_STATE_PORT MP_STATE_VM
#define MICROPY_PORT_ROOT_POINTERS \
mp_obj_t mp_kbd_exception; \
const char *readline_hist[8];
// Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles
...
...
zephyr/mphalport.h
View file @
93c76d2b
static
inline
mp_uint_t
mp_hal_ticks_ms
(
void
)
{
return
0
;
}
static
inline
void
mp_hal_set_interrupt_char
(
char
c
)
{}
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