Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
a770ba14
Commit
a770ba14
authored
Dec 15, 2016
by
Damien George
Browse files
stmhal: Use core-provided keyboard exception object.
parent
d89cafd5
Changes
4
Hide whitespace changes
Inline
Side-by-side
stmhal/main.c
View file @
a770ba14
...
...
@@ -438,7 +438,6 @@ soft_reset:
mp_obj_list_append
(
mp_sys_path
,
MP_OBJ_NEW_QSTR
(
MP_QSTR__slash_flash
));
mp_obj_list_append
(
mp_sys_path
,
MP_OBJ_NEW_QSTR
(
MP_QSTR__slash_flash_slash_lib
));
mp_obj_list_init
(
mp_sys_argv
,
0
);
MP_STATE_PORT
(
mp_kbd_exception
)
=
mp_obj_new_exception
(
&
mp_type_KeyboardInterrupt
);
// Initialise low-level sub-systems. Here we need to very basic things like
// zeroing out memory and resetting any of the sub-systems. Following this
...
...
stmhal/mpconfigport.h
View file @
a770ba14
...
...
@@ -42,6 +42,7 @@
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_KBD_EXCEPTION (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_REPL_EMACS_KEYS (1)
#define MICROPY_REPL_AUTO_INDENT (1)
...
...
@@ -208,7 +209,6 @@ extern const struct _mp_obj_module_t mp_module_network;
#define MICROPY_PORT_ROOT_POINTERS \
const char *readline_hist[8]; \
\
mp_obj_t mp_kbd_exception; \
mp_obj_t pyb_hid_report_desc; \
\
mp_obj_t pyb_config_main; \
...
...
stmhal/usb.c
View file @
a770ba14
...
...
@@ -144,7 +144,7 @@ bool usb_vcp_is_enabled(void) {
void
usb_vcp_set_interrupt_char
(
int
c
)
{
if
(
pyb_usb_flags
&
PYB_USB_FLAG_DEV_ENABLED
)
{
if
(
c
!=
-
1
)
{
mp_obj_exception_clear_traceback
(
MP_STATE_
PORT
(
mp_kbd_exception
));
mp_obj_exception_clear_traceback
(
MP_
OBJ_FROM_PTR
(
&
MP_
STATE_
VM
(
mp_kbd_exception
))
)
;
}
USBD_CDC_SetInterrupt
(
c
);
}
...
...
stmhal/usbd_cdc_interface.c
View file @
a770ba14
...
...
@@ -353,7 +353,7 @@ static int8_t CDC_Itf_Receive(uint8_t* Buf, uint32_t *Len) {
if
(
*
src
==
user_interrupt_char
)
{
char_found
=
true
;
// raise exception when interrupts are finished
pendsv_nlr_jump
(
MP_STATE_
PORT
(
mp_kbd_exception
));
pendsv_nlr_jump
(
&
MP_STATE_
VM
(
mp_kbd_exception
));
}
else
{
if
(
char_found
)
{
*
dest
=
*
src
;
...
...
Write
Preview
Supports
Markdown
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