esp8266: Enable DHT C-level driver.

Exposed as esp.dht_readinto.  Probably should go somewhere less
port-specific.
This commit is contained in:
Damien George 2016-05-26 17:11:43 +01:00
parent 48a7ef0576
commit 45f3416816
3 changed files with 12 additions and 1 deletions

View File

@ -124,6 +124,10 @@ LIB_SRC_C = $(addprefix lib/,\
fatfs/option/ccsbcs.c \
)
DRIVERS_SRC_C = $(addprefix drivers/,\
dht/dht.c \
)
SRC_S = \
gchelper.s \
@ -134,10 +138,11 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o))
#OBJ += $(BUILD)/pins_$(BOARD).o
# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(STM_SRC_C) $(EXTMOD_SRC_C)
SRC_QSTR += $(SRC_C) $(STM_SRC_C) $(EXTMOD_SRC_C) $(DRIVERS_SRC_C)
# Append any auto-generated sources that are needed by sources listed in SRC_QSTR
SRC_QSTR_AUTO_DEPS +=

View File

@ -28,6 +28,7 @@
#define _INCLUDED_MPHAL_H_
#include "py/ringbuf.h"
#include "xtirq.h"
void mp_keyboard_interrupt(void);
extern int interrupt_char;
@ -62,6 +63,9 @@ void ets_event_poll(void);
#include "osapi.h"
#define mp_hal_delay_us_fast(us) os_delay_us(us)
#define mp_hal_quiet_timing_enter() disable_irq()
#define mp_hal_quiet_timing_exit(irq_state) enable_irq(irq_state)
// C-level pin HAL
#include "etshal.h"
#include "gpio.h"

View File

@ -34,6 +34,7 @@
#include "py/runtime.h"
#include "py/mperrno.h"
#include "py/mphal.h"
#include "drivers/dht/dht.h"
#include "netutils.h"
#include "queue.h"
#include "ets_sys.h"
@ -691,6 +692,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write), (mp_obj_t)&esp_neopixel_write_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_apa102_write), (mp_obj_t)&esp_apa102_write_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_dht_readinto), (mp_obj_t)&dht_readinto_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_freemem), (mp_obj_t)&esp_freemem_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_meminfo), (mp_obj_t)&esp_meminfo_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, // TODO delete/rename/move elsewhere