From 8517494b239d652ea9a24457faa13f88f55979b9 Mon Sep 17 00:00:00 2001
From: Guo Wenxue <guowenxue@gmail.com>
Date: Sun, 29 Dec 2024 14:45:29 +0800
Subject: [PATCH] Update infrared code to support two channels

---
 modules/leds.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/modules/leds.c b/modules/leds.c
index 6f68356..8c3c7b0 100644
--- a/modules/leds.c
+++ b/modules/leds.c
@@ -13,6 +13,12 @@
  *                   B        <----->      #Pin37(BCM GPIO26)
  *                  GND       <----->      GND
  *
+ *               RGB Led Module           Raspberry Pi Board
+ *                   R        <----->      #Pin36(BCM GPIO16)
+ *                   G        <----->      #Pin38(BCM GPIO20)
+ *                   B        <----->      #Pin40(BCM GPIO21)
+ *                  GND       <----->      GND
+ *
  * System install:
  *                  sudo apt install -y libgpiod-dev gpiod
  *
@@ -54,11 +60,20 @@
     struct gpiod_line  *line;  /* libgpiod line */
 } led_info_t;
 
+#define CONFIG_PIN_333537
+//#define CONFIG_PIN_363840
+
 static led_info_t    leds_info[LEDCNT] =
 {
+#ifdef CONFIG_PIN_333537
     {"red",   13, 1, NULL },
     {"green", 19, 1, NULL },
     {"blue",  26, 1, NULL },
+#elif (defined CONFIG_PIN_363840)
+    {"red",   16, 1, NULL },
+    {"green", 20, 1, NULL },
+    {"blue",  21, 1, NULL },
+#endif
 };
 
 /* Three LEDs API context */

--
Gitblit v1.9.1