esp8266: Move pyb.hard_reset() to machine.reset().
diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c
index 5cf6f58..89cf4fb 100644
--- a/esp8266/modmachine.c
+++ b/esp8266/modmachine.c
@@ -57,6 +57,12 @@
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_freq_obj, 0, 1, machine_freq);
+STATIC mp_obj_t machine_reset(void) {
+ system_restart();
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_obj, machine_reset);
+
typedef struct _esp_timer_obj_t {
mp_obj_base_t base;
os_timer_t timer;
@@ -139,6 +145,7 @@
{ MP_ROM_QSTR(MP_QSTR_mem32), MP_ROM_PTR(&machine_mem32_obj) },
{ MP_ROM_QSTR(MP_QSTR_freq), MP_ROM_PTR(&machine_freq_obj) },
+ { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&machine_reset_obj) },
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&esp_timer_type) },
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&pyb_pin_type) },