From 7a0488541f68d1a9eb712a4eb5c6c36da150bc4a Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Fri, 23 Apr 2021 22:43:13 +0800 Subject: [PATCH] update iotd and test infared ok --- iotd/hal/gpio.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/iotd/hal/gpio.h b/iotd/hal/gpio.h index 6a45e11..804916a 100644 --- a/iotd/hal/gpio.h +++ b/iotd/hal/gpio.h @@ -36,6 +36,7 @@ gpio_info_t input[GPIO_MAXIN]; /* GPIO input pins */ int incnt; /* GPIO input numbers */ + int infrared_enable; /* infrared enable or not */ } gpio_t; extern int gpio_init(gpio_t *gpio); @@ -44,7 +45,13 @@ /* turn which light on/off */ extern void gpio_out(char *name, char *cmd); + +/*thread work body to turn light $name on for some seconds */ +void *light_on_worker(void *arg); + /* Return value: 0(LOW): Nobody detected, !0: Which infrared detect incoming */ +#define FLAG_INFRARED_INDOOR (1<<0) +#define FLAG_INFRARED_HALLWAY (1<<1) extern int infrared_detect(void); #endif /* ----- #ifndef _GPIO_H_ ----- */ -- Gitblit v1.9.1