From 88f6121fabaa6b7b17a2d78a52ebef2ddda16104 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 23 Jan 2021 23:14:43 +0800
Subject: [PATCH] add LUX sensor tsl2561 support in lightd

---
 lightd/hal/hal.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lightd/hal/hal.c b/lightd/hal/hal.c
index 25ac288..4428bb6 100644
--- a/lightd/hal/hal.c
+++ b/lightd/hal/hal.c
@@ -12,6 +12,7 @@
  ********************************************************************************/
 
 #include "lylib/logger.h"
+#include "tsl2561.h"
 #include "hal.h"
 
 #define RPI_GPIONAME        "gpiochip0"
@@ -63,6 +64,13 @@
     {
 	s_infrared_lines = gpiod_chip_get_line(s_chip, ctx->infrared_pin);
 	gpiod_line_request_rising_edge_events(s_infrared_lines, "infrared");
+	log_err("infrared GPIO input lines request for rising edge event ok\n");
+    }
+
+    if( tsl2561_init()< 0 )
+    {
+	log_err("LUX sensor TSL2561 initialise failure\n");
+	return -2;
     }
 
 

--
Gitblit v1.9.1