24
24
* THE SOFTWARE.
25
25
*/
26
26
27
+ #include "py/builtin.h"
27
28
#include "py/runtime.h"
28
29
29
30
#if MICROPY_PY_MACHINE
35
36
#include "drivers/dht/dht.h"
36
37
#endif
37
38
39
+ #if !MICROPY_PY_SYS_EXIT
40
+ #error MICROPY_PY_MACHINE requires MICROPY_PY_SYS_EXIT
41
+ #endif
42
+
38
43
// The port must provide implementations of these low-level machine functions.
39
44
40
45
static void mp_machine_idle (void );
@@ -61,11 +66,6 @@ NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args);
61
66
#include MICROPY_PY_MACHINE_INCLUDEFILE
62
67
#endif
63
68
64
- static mp_obj_t machine_soft_reset (void ) {
65
- mp_raise_type (& mp_type_SystemExit );
66
- }
67
- static MP_DEFINE_CONST_FUN_OBJ_0 (machine_soft_reset_obj , machine_soft_reset ) ;
68
-
69
69
#if MICROPY_PY_MACHINE_BOOTLOADER
70
70
NORETURN mp_obj_t machine_bootloader (size_t n_args , const mp_obj_t * args ) {
71
71
mp_machine_bootloader (n_args , args );
@@ -156,7 +156,7 @@ static const mp_rom_map_elem_t machine_module_globals_table[] = {
156
156
#endif
157
157
158
158
// Reset related functions.
159
- { MP_ROM_QSTR (MP_QSTR_soft_reset ), MP_ROM_PTR (& machine_soft_reset_obj ) },
159
+ { MP_ROM_QSTR (MP_QSTR_soft_reset ), MP_ROM_PTR (& mp_sys_exit_obj ) },
160
160
#if MICROPY_PY_MACHINE_BOOTLOADER
161
161
{ MP_ROM_QSTR (MP_QSTR_bootloader ), MP_ROM_PTR (& machine_bootloader_obj ) },
162
162
#endif
0 commit comments