We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent addd1d3 commit 52784bfCopy full SHA for 52784bf
esp8266/modmachine.c
@@ -86,8 +86,10 @@ STATIC mp_obj_t machine_unique_id(void) {
86
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_unique_id_obj, machine_unique_id);
87
88
STATIC mp_obj_t machine_idle(void) {
89
+ uint32_t t = mp_hal_ticks_cpu();
90
asm("waiti 0");
- return mp_const_none;
91
+ t = mp_hal_ticks_cpu() - t;
92
+ return MP_OBJ_NEW_SMALL_INT(t);
93
}
94
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);
95
0 commit comments