Skip to content

Commit eefd946

Browse files
robert-hhdpgeorge
authored andcommitted
esp32/modmachine: Move dht_readinto() to the machine module.
1 parent a495eb4 commit eefd946

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ports/esp32/modesp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "py/runtime.h"
3636
#include "py/mperrno.h"
3737
#include "py/mphal.h"
38-
#include "drivers/dht/dht.h"
3938

4039
STATIC mp_obj_t esp_osdebug(size_t n_args, const mp_obj_t *args) {
4140
esp_log_level_t level = LOG_LOCAL_LEVEL;
@@ -125,8 +124,6 @@ STATIC const mp_rom_map_elem_t esp_module_globals_table[] = {
125124
{ MP_ROM_QSTR(MP_QSTR_gpio_matrix_in), MP_ROM_PTR(&esp_gpio_matrix_in_obj) },
126125
{ MP_ROM_QSTR(MP_QSTR_gpio_matrix_out), MP_ROM_PTR(&esp_gpio_matrix_out_obj) },
127126

128-
{ MP_ROM_QSTR(MP_QSTR_dht_readinto), MP_ROM_PTR(&dht_readinto_obj) },
129-
130127
// Constants for second arg of osdebug()
131128
{ MP_ROM_QSTR(MP_QSTR_LOG_NONE), MP_ROM_INT((mp_uint_t)ESP_LOG_NONE)},
132129
{ MP_ROM_QSTR(MP_QSTR_LOG_ERROR), MP_ROM_INT((mp_uint_t)ESP_LOG_ERROR)},

ports/esp32/modmachine.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "py/obj.h"
5050
#include "py/runtime.h"
5151
#include "shared/runtime/pyexec.h"
52+
#include "drivers/dht/dht.h"
5253
#include "extmod/machine_bitstream.h"
5354
#include "extmod/machine_mem.h"
5455
#include "extmod/machine_signal.h"
@@ -295,6 +296,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
295296
#if MICROPY_PY_MACHINE_PULSE
296297
{ MP_ROM_QSTR(MP_QSTR_time_pulse_us), MP_ROM_PTR(&machine_time_pulse_us_obj) },
297298
#endif
299+
{ MP_ROM_QSTR(MP_QSTR_dht_readinto), MP_ROM_PTR(&dht_readinto_obj) },
298300

299301
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
300302
{ MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&machine_wdt_type) },

0 commit comments

Comments
 (0)