summaryrefslogtreecommitdiff
path: root/cc3200/misc/mpexception.c
diff options
context:
space:
mode:
Diffstat (limited to 'cc3200/misc/mpexception.c')
-rw-r--r--cc3200/misc/mpexception.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/cc3200/misc/mpexception.c b/cc3200/misc/mpexception.c
index 72b203fae..2dfcbfdef 100644
--- a/cc3200/misc/mpexception.c
+++ b/cc3200/misc/mpexception.c
@@ -33,59 +33,8 @@
/******************************************************************************
-DECLARE PRIVATE FUNCTIONS
- ******************************************************************************/
-STATIC void mpexception_set_user_interrupt (int chr, void *data);
-
-/******************************************************************************
DECLARE EXPORTED DATA
******************************************************************************/
const char mpexception_value_invalid_arguments[] = "invalid argument(s) value";
const char mpexception_num_type_invalid_arguments[] = "invalid argument(s) num/type";
const char mpexception_uncaught[] = "uncaught exception";
-
-int user_interrupt_char = -1;
-
-/******************************************************************************
-DECLARE PRIVATE DATA
- ******************************************************************************/
-STATIC void *user_interrupt_data = NULL;
-
-/******************************************************************************
-DEFINE PUBLIC FUNCTIONS
- ******************************************************************************/
-
-void mpexception_init0 (void) {
- // Create an exception object for interrupting through the stdin uart
- MP_STATE_PORT(mp_const_user_interrupt) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
- mpexception_set_user_interrupt (-1, MP_STATE_PORT(mp_const_user_interrupt));
-}
-
-void mpexception_set_interrupt_char (int c) {
- if (c != -1) {
- mp_obj_exception_clear_traceback(MP_STATE_PORT(mp_const_user_interrupt));
- }
- mpexception_set_user_interrupt(c, MP_STATE_PORT(mp_const_user_interrupt));
-}
-
-// Call this function to raise a pending exception during an interrupt.
-// It will try to raise the exception "softly" by setting the
-// mp_pending_exception variable hoping that the VM will notice it.
-void mpexception_nlr_jump (void *o) {
- if (MP_STATE_PORT(mp_pending_exception) == MP_OBJ_NULL) {
- MP_STATE_PORT(mp_pending_exception) = o;
- }
-}
-
-void mpexception_keyboard_nlr_jump (void) {
- mpexception_nlr_jump (user_interrupt_data);
-}
-
-/******************************************************************************
-DEFINE PRIVATE FUNCTIONS
- ******************************************************************************/
-
-STATIC void mpexception_set_user_interrupt (int chr, void *data) {
- user_interrupt_char = chr;
- user_interrupt_data = data;
-}