This commit is contained in:
Peter D. Gray 2020-08-04 15:31:43 -04:00
parent a094a0a55e
commit db4e297ea1
No known key found for this signature in database
GPG Key ID: F0E6CC6AFC16CF7B
4 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#ifdef MICROPY_HW_ENABLE_DHT
/*
* This file is part of the MicroPython project, http://micropython.org/
*
@ -87,3 +88,5 @@ timeout:
mp_raise_OSError(MP_ETIMEDOUT);
}
MP_DEFINE_CONST_FUN_OBJ_2(dht_readinto_obj, dht_readinto);
#endif

View File

@ -630,7 +630,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_disable_irq), MP_ROM_PTR(&pyb_disable_irq_obj) },
{ MP_ROM_QSTR(MP_QSTR_enable_irq), MP_ROM_PTR(&pyb_enable_irq_obj) },
#if MICROPY_PY_MACHINE_PULSE
{ MP_ROM_QSTR(MP_QSTR_time_pulse_us), MP_ROM_PTR(&machine_time_pulse_us_obj) },
#endif
{ MP_ROM_QSTR(MP_QSTR_mem8), MP_ROM_PTR(&machine_mem8_obj) },
{ MP_ROM_QSTR(MP_QSTR_mem16), MP_ROM_PTR(&machine_mem16_obj) },

View File

@ -30,7 +30,9 @@
#include "py/runtime.h"
#include "py/mphal.h"
#include "lib/utils/pyexec.h"
#if MICROPY_HW_ENABLE_DHT
#include "drivers/dht/dht.h"
#endif
#include "stm32_it.h"
#include "irq.h"
#include "led.h"
@ -164,8 +166,10 @@ STATIC const mp_rom_map_elem_t pyb_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&mp_vfs_mount_obj) },
#endif
#if MICROPY_HW_ENABLE_DHT
// This function is not intended to be public and may be moved elsewhere
{ MP_ROM_QSTR(MP_QSTR_dht_readinto), MP_ROM_PTR(&dht_readinto_obj) },
#endif
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&pyb_timer_type) },

View File

@ -224,3 +224,9 @@
#endif
#define MICROPY_HW_USES_BOOTLOADER (MICROPY_HW_VTOR != 0x08000000)
// drivers/dht ... a specific enviro sensor of some sort
#ifndef MICROPY_HW_ENABLE_DHT
#define MICROPY_HW_ENABLE_DHT (1)
#endif