From f696e95a01ee103605a9ed5fd23de58847ab9abc Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 03 Nov 2021 22:47:05 +0800
Subject: [PATCH] rename gpio.c to gpiod.c for it will conflict with rpi gpio command
---
iotd/hal/gpio.h | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/iotd/hal/gpio.h b/iotd/hal/gpio.h
index 2a12d84..804916a 100644
--- a/iotd/hal/gpio.h
+++ b/iotd/hal/gpio.h
@@ -16,9 +16,6 @@
#include <gpiod.h>
-#define OFF 0
-#define ON 1
-
#define GPIO_MAXOUT 8
#define GPIO_MAXIN 4
@@ -39,19 +36,22 @@
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);
extern void gpio_term(void);
-
/* turn which light on/off */
-extern void turn_light(int which, int cmd);
+extern void gpio_out(char *name, char *cmd);
-/* turn which led on/off */
-extern void turn_led(int which, int 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