summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/modpyb.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r--stmhal/modpyb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c
index 53b4335e79..93ae5d40ba 100644
--- a/stmhal/modpyb.c
+++ b/stmhal/modpyb.c
@@ -38,6 +38,7 @@
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "gccollect.h"
+#include "stm32_it.h"
#include "irq.h"
#include "systick.h"
#include "led.h"
@@ -64,6 +65,12 @@
#include "extmod/vfs.h"
#include "extmod/utime_mphal.h"
+STATIC mp_obj_t pyb_fault_debug(mp_obj_t value) {
+ pyb_hard_fault_debug = mp_obj_is_true(value);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_fault_debug_obj, pyb_fault_debug);
+
/// \function millis()
/// Returns the number of milliseconds since the board was last reset.
///
@@ -131,6 +138,8 @@ MP_DECLARE_CONST_FUN_OBJ_KW(pyb_main_obj); // defined in main.c
STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_fault_debug), (mp_obj_t)&pyb_fault_debug_obj },
+
{ MP_OBJ_NEW_QSTR(MP_QSTR_bootloader), (mp_obj_t)&machine_bootloader_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_hard_reset), (mp_obj_t)&machine_reset_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&machine_info_obj },