Skip to content

Commit 71f7de3

Browse files
committed
Merge branch 'dev-deepsleep' into dev-x
2 parents 7f7fb2a + 56e40ad commit 71f7de3

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

ports/esp32/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ SRC_C = \
144144
machine_hw_spi.c \
145145
machine_wdt.c \
146146
mpthreadport.c \
147+
machine_rtc.c \
147148
$(SRC_MOD)
148149

149150
EXTMOD_SRC_C = $(addprefix extmod/,\
@@ -243,6 +244,7 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
243244
dport_access.o \
244245
wifi_init.o \
245246
wifi_internal.o \
247+
sleep_modes.o \
246248
)
247249

248250
ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\

ports/esp32/modmachine.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "machine_rtc.h"
4848

4949
#if MICROPY_PY_MACHINE
50+
#define MACHINE_WAKE_DEEPSLEEP (0x04)
5051

5152
extern machine_rtc_config_t machine_rtc_config;
5253

@@ -148,6 +149,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
148149
{ MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&machine_reset_obj) },
149150
{ MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&machine_deepsleep_obj) },
150151
{ MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) },
152+
{ MP_ROM_QSTR(MP_QSTR_deepsleep), MP_ROM_PTR(&machine_deepsleep_obj) },
151153
{ MP_ROM_QSTR(MP_QSTR_idle), MP_ROM_PTR(&machine_idle_obj) },
152154

153155
{ MP_ROM_QSTR(MP_QSTR_disable_irq), MP_ROM_PTR(&machine_disable_irq_obj) },
@@ -158,6 +160,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
158160
{ MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&machine_wdt_type) },
159161
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
160162
{ MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&machine_wdt_type) },
163+
// wake abilities
164+
{ MP_ROM_QSTR(MP_QSTR_DEEPSLEEP), MP_ROM_INT(MACHINE_WAKE_DEEPSLEEP) },
165+
161166
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
162167
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
163168
{ MP_ROM_QSTR(MP_QSTR_TouchPad), MP_ROM_PTR(&machine_touchpad_type) },
@@ -166,6 +171,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
166171
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_i2c_type) },
167172
{ MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&machine_rtc_type) },
168173
{ MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&machine_pwm_type) },
174+
{ MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&machine_rtc_type) },
169175
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&mp_machine_soft_spi_type) },
170176
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&machine_uart_type) },
171177
};

ports/esp32/modmachine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ extern const mp_obj_type_t machine_uart_type;
1717

1818
void machine_pins_init(void);
1919
void machine_pins_deinit(void);
20+
extern const mp_obj_type_t machine_rtc_type;
2021

2122
#endif // MICROPY_INCLUDED_ESP32_MODMACHINE_H

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