diff options
author | Damien George <damien.p.george@gmail.com> | 2019-09-23 17:15:07 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-09-23 17:15:07 +1000 |
commit | ca8ff99e8c48803528a97c0b4a3d9b1d0eafe2fa (patch) | |
tree | 22fc224f5876de111ac16789bcb8725cc7bce024 /ports/stm32/timer.c | |
parent | 4f78ba3cf4db499e863547a05088012b87543cbb (diff) |
stm32: Use mp_printf with MICROPY_ERROR_PRINTER for uncaught exceptions.
Diffstat (limited to 'ports/stm32/timer.c')
-rw-r--r-- | ports/stm32/timer.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ports/stm32/timer.c b/ports/stm32/timer.c index cd01a4174..3b9f1dc40 100644 --- a/ports/stm32/timer.c +++ b/ports/stm32/timer.c @@ -25,7 +25,6 @@ */ #include <stdint.h> -#include <stdio.h> #include <string.h> #include "py/runtime.h" @@ -1548,9 +1547,9 @@ STATIC void timer_handle_irq_channel(pyb_timer_obj_t *tim, uint8_t channel, mp_o tim->callback = mp_const_none; __HAL_TIM_DISABLE_IT(&tim->tim, irq_mask); if (channel == 0) { - printf("uncaught exception in Timer(%u) interrupt handler\n", tim->tim_id); + mp_printf(MICROPY_ERROR_PRINTER, "uncaught exception in Timer(%u) interrupt handler\n", tim->tim_id); } else { - printf("uncaught exception in Timer(%u) channel %u interrupt handler\n", tim->tim_id, channel); + mp_printf(MICROPY_ERROR_PRINTER, "uncaught exception in Timer(%u) channel %u interrupt handler\n", tim->tim_id, channel); } mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val)); } @@ -1591,7 +1590,7 @@ void timer_irq_handler(uint tim_id) { if (unhandled != 0) { __HAL_TIM_DISABLE_IT(&tim->tim, unhandled); __HAL_TIM_CLEAR_IT(&tim->tim, unhandled); - printf("Unhandled interrupt SR=0x%02x (now disabled)\n", (unsigned int)unhandled); + mp_printf(MICROPY_ERROR_PRINTER, "unhandled interrupt SR=0x%02x (now disabled)\n", (unsigned int)unhandled); } } } |