esp8266/modmachine: Rename machine.sleep to machine.lightsleep.

While keeping machine.sleep as an alias for machine.lightsleep for
backwards compatibility.
This commit is contained in:
Damien George 2019-01-30 13:39:11 +11:00
parent d7cc92383c
commit 2911e3554a
1 changed files with 4 additions and 3 deletions

View File

@ -96,11 +96,11 @@ STATIC mp_obj_t machine_idle(void) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);
STATIC mp_obj_t machine_sleep(void) {
STATIC mp_obj_t machine_lightsleep(size_t n_args, const mp_obj_t *args) {
printf("Warning: not yet implemented\n");
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_sleep_obj, machine_sleep);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lightsleep_obj, 0, 1, machine_lightsleep);
STATIC mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *args) {
// default to sleep forever
@ -298,7 +298,8 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_reset_cause), MP_ROM_PTR(&machine_reset_cause_obj) },
{ MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) },
{ MP_ROM_QSTR(MP_QSTR_idle), MP_ROM_PTR(&machine_idle_obj) },
{ MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&machine_sleep_obj) },
{ MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&machine_lightsleep_obj) },
{ MP_ROM_QSTR(MP_QSTR_lightsleep), MP_ROM_PTR(&machine_lightsleep_obj) },
{ MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&machine_deepsleep_obj) },
{ MP_ROM_QSTR(MP_QSTR_disable_irq), MP_ROM_PTR(&machine_disable_irq_obj) },