Skip to content

Commit 31ad1bb

Browse files
committed
esp8266/modmachine: Implement dummy sleep() function.
1 parent 541e76f commit 31ad1bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

esp8266/modmachine.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

2828
#include <stdint.h>
29+
#include <stdio.h>
2930

3031
#include "py/obj.h"
3132
#include "py/runtime.h"
@@ -88,6 +89,12 @@ STATIC mp_obj_t machine_idle(void) {
8889
}
8990
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);
9091

92+
STATIC mp_obj_t machine_sleep(void) {
93+
printf("Warning: not yet implemented\n");
94+
return mp_const_none;
95+
}
96+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_sleep_obj, machine_sleep);
97+
9198
STATIC mp_obj_t machine_deepsleep(void) {
9299
// default to sleep forever
93100
uint32_t sleep_us = 0;
@@ -229,6 +236,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
229236
{ MP_ROM_QSTR(MP_QSTR_reset_cause), MP_ROM_PTR(&machine_reset_cause_obj) },
230237
{ MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) },
231238
{ MP_ROM_QSTR(MP_QSTR_idle), MP_ROM_PTR(&machine_idle_obj) },
239+
{ MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&machine_sleep_obj) },
232240
{ MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&machine_deepsleep_obj) },
233241

234242
{ MP_ROM_QSTR(MP_QSTR_disable_irq), MP_ROM_PTR(&machine_disable_irq_obj) },

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy