diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-12-06 14:29:09 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-12-08 20:25:49 +0000 |
commit | 46c3ab20049af16e97863e90e5761fae329f872a (patch) | |
tree | cbe6230dcad6972d7d50c6d08c4e4c4da215abb1 /teensy/timer.c | |
parent | d0caaadaeea48e8f76dca3125a2dea3465a58416 (diff) | |
download | micropython-46c3ab20049af16e97863e90e5761fae329f872a.tar.gz micropython-46c3ab20049af16e97863e90e5761fae329f872a.zip |
modsys: Add sys.print_exception(exc, file=sys.stdout) function.
The function is modeled after traceback.print_exception(), but unbloated,
and put into existing module to save overhead on adding another module.
Compliant traceback.print_exception() is intended to be implemented in
micropython-lib in terms of sys.print_exception().
This change required refactoring mp_obj_print_exception() to take pfenv_t
interface arguments.
Addresses #751.
Diffstat (limited to 'teensy/timer.c')
-rw-r--r-- | teensy/timer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/teensy/timer.c b/teensy/timer.c index 81450698b3..a4051e608c 100644 --- a/teensy/timer.c +++ b/teensy/timer.c @@ -35,6 +35,7 @@ #include "qstr.h" #include "obj.h" #include "runtime.h" +#include "pfenv.h" #include MICROPY_HAL_H #include "gc.h" #include "pin.h" @@ -917,7 +918,7 @@ STATIC bool ftm_handle_irq_callback(pyb_timer_obj_t *self, mp_uint_t channel, mp printf("Uncaught exception in Timer(" UINT_FMT ") channel " UINT_FMT " interrupt handler\n", self->tim_id, channel); } - mp_obj_print_exception((mp_obj_t)nlr.ret_val); + mp_obj_print_exception(printf_wrapper, NULL, (mp_obj_t)nlr.ret_val); } gc_unlock(); return handled; |