Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
7bc84f6f
Verified
Commit
7bc84f6f
authored
Jul 04, 2019
by
Rahix
Browse files
fix(pycardium): Properly handle ^C
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
940708d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycardium/mphalport.c
View file @
7bc84f6f
...
...
@@ -37,16 +37,24 @@ void TMR5_IRQHandler(void)
TMR_IntClear
(
MXC_TMR5
);
if
(
do_interrupt
)
{
/* Taken from lib/micropython/micropython/ports/unix/unix_mphal.c */
mp_obj_exception_clear_traceback
(
MP_OBJ_FROM_PTR
(
&
MP_STATE_VM
(
mp_kbd_exception
))
);
nlr_raise
(
MP_OBJ_FROM_PTR
(
&
MP_STATE_VM
(
mp_kbd_exception
)));
/* Taken from lib/micropython/micropython/lib/utils/interrupt_char.c */
MP_STATE_VM
(
mp_pending_exception
)
=
MP_OBJ_FROM_PTR
(
&
MP_STATE_VM
(
mp_kbd_exception
));
#if MICROPY_ENABLE_SCHEDULER
if
(
MP_STATE_VM
(
sched_state
)
==
MP_SCHED_IDLE
)
{
MP_STATE_VM
(
sched_state
)
=
MP_SCHED_PENDING
;
}
#endif
}
}
void
mp_hal_set_interrupt_char
(
char
c
)
{
if
(
c
!=
-
1
)
{
mp_obj_exception_clear_traceback
(
MP_OBJ_FROM_PTR
(
&
MP_STATE_VM
(
mp_kbd_exception
))
);
}
do_interrupt
=
(
c
==
0x03
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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