File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333#include "pyexec.h"
3434#include "pybstdio.h"
3535#include MICROPY_HAL_H
36+ #include "user_interface.h"
3637
3738STATIC mp_obj_t pyb_info (mp_uint_t n_args , const mp_obj_t * args ) {
3839 // print info about memory
@@ -136,6 +137,12 @@ STATIC mp_obj_t pyb_udelay(mp_obj_t usec_in) {
136137}
137138STATIC MP_DEFINE_CONST_FUN_OBJ_1 (pyb_udelay_obj , pyb_udelay );
138139
140+ STATIC mp_obj_t pyb_hard_reset (void ) {
141+ system_restart ();
142+ return mp_const_none ;
143+ }
144+ STATIC MP_DEFINE_CONST_FUN_OBJ_0 (pyb_hard_reset_obj , pyb_hard_reset );
145+
139146STATIC const mp_map_elem_t pyb_module_globals_table [] = {
140147 { MP_OBJ_NEW_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_pyb ) },
141148
@@ -149,6 +156,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
149156 { MP_OBJ_NEW_QSTR (MP_QSTR_delay ), (mp_obj_t )& pyb_delay_obj },
150157 { MP_OBJ_NEW_QSTR (MP_QSTR_udelay ), (mp_obj_t )& pyb_udelay_obj },
151158 { MP_OBJ_NEW_QSTR (MP_QSTR_sync ), (mp_obj_t )& pyb_sync_obj },
159+ { MP_OBJ_NEW_QSTR (MP_QSTR_hard_reset ), (mp_obj_t )& pyb_hard_reset_obj },
152160};
153161
154162STATIC MP_DEFINE_CONST_DICT (pyb_module_globals , pyb_module_globals_table );
You can’t perform that action at this time.
0 commit comments