From 72fea370ff20ecb2494ab985c4431b4bd691e7cd Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Mon, 17 Nov 2025 15:11:05 +0800
Subject: [PATCH] update lighted program
---
project/lightd/hal/gpio.h | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/project/lightd/hal/gpio.h b/project/lightd/hal/gpio.h
index 29e970a..3a085e1 100644
--- a/project/lightd/hal/gpio.h
+++ b/project/lightd/hal/gpio.h
@@ -21,33 +21,28 @@
typedef struct gpio_info_s
{
- char name[32]; /* GPIO connected module name */
- int pin; /* GPIO BCM pin number */
- int active_level; /* active power level */
- struct gpiod_line *line; /* gpiod line */
+ struct gpiod_line *line; /* gpiod line */
+ char name[32]; /* GPIO connected module name */
+ int pin; /* GPIO BCM pin number */
+ int active_level; /* active power level */
} gpio_info_t;
-
typedef struct gpio_s
{
- gpio_info_t output[GPIO_MAXOUT]; /* GPIO output pins */
- int outcnt; /* GPIO output numbers */
- int light_intval; /* light on interval time */
+ gpio_info_t output[GPIO_MAXOUT]; /* GPIO output pins */
+ int outcnt; /* GPIO output numbers */
- gpio_info_t input[GPIO_MAXIN]; /* GPIO input pins */
- int incnt; /* GPIO input numbers */
- int infrared_enable; /* infrared enable or not */
+ gpio_info_t input[GPIO_MAXIN]; /* GPIO input pins */
+ int incnt; /* GPIO input numbers */
} gpio_t;
extern int gpio_init(gpio_t *gpio);
extern void gpio_term(void);
-/* 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);
+/* turn which light ON/OFF */
+#define OFF 0
+#define ON 1
+extern void turn_light(char *name, int status);
/* Return value: 0(LOW): Nobody detected, !0: Which infrared detect incoming */
#define FLAG_INFRARED_INDOOR (1<<0)
--
Gitblit v1.9.1