File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11# DHT11/DHT22 driver for MicroPython on ESP8266
22# MIT license; Copyright (c) 2016 Damien P. George
33
4- try :
4+ import sys
5+
6+ if sys .platform .startswith ("esp" ):
57 from esp import dht_readinto
6- except :
8+ elif sys .platform == "mimxrt" :
9+ from mimxrt import dht_readinto
10+ else :
711 from pyb import dht_readinto
812
913
Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ SRC_C += \
213213 board_init.c \
214214 dma_channel.c \
215215 drivers/bus/softspi.c \
216+ drivers/dht/dht.c \
216217 eth.c \
217218 extmod/modnetwork.c \
218219 extmod/modonewire.c \
Original file line number Diff line number Diff line change 11freeze ("$(PORT_DIR)/modules" )
22freeze ("$(MPY_DIR)/drivers/onewire" )
3+ freeze ("$(MPY_DIR)/drivers/dht" , "dht.py" )
34include ("$(MPY_DIR)/extmod/uasyncio/manifest.py" )
Original file line number Diff line number Diff line change 2424 * THE SOFTWARE.
2525 */
2626
27+ #include "py/mperrno.h"
2728#include "py/runtime.h"
29+ #include "drivers/dht/dht.h"
2830#include "modmimxrt.h"
2931
3032STATIC const mp_rom_map_elem_t mimxrt_module_globals_table [] = {
3133 { MP_ROM_QSTR (MP_QSTR___name__ ), MP_ROM_QSTR (MP_QSTR_mimxrt ) },
3234 { MP_ROM_QSTR (MP_QSTR_Flash ), MP_ROM_PTR (& mimxrt_flash_type ) },
35+
36+ { MP_ROM_QSTR (MP_QSTR_dht_readinto ), MP_ROM_PTR (& dht_readinto_obj ) },
3337};
3438STATIC MP_DEFINE_CONST_DICT (mimxrt_module_globals , mimxrt_module_globals_table );
3539
You can’t perform that action at this time.
0 commit comments