All of lore.kernel.org
 help / color / mirror / Atom feed
From: OpenBMC Patches <openbmc-patches@stwcx.xyz>
To: openbmc@lists.ozlabs.org
Cc: Ken <ken.sk.lai@mail.foxconn.com>
Subject: [PATCH skeleton v3 11/19] LED test
Date: Thu, 19 Nov 2015 20:00:25 -0500	[thread overview]
Message-ID: <1447981233-5573-12-git-send-email-openbmc-patches@stwcx.xyz> (raw)
In-Reply-To: <1447981233-5573-1-git-send-email-openbmc-patches@stwcx.xyz>

From: Ken <ken.sk.lai@mail.foxconn.com>

---
 bin/Barreleye.py         |  1 +
 objects/led_controller.c | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 objects/led_controller.c

diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index 3782766..9f3d1d1 100755
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -470,6 +470,7 @@ GPIO_CONFIG['BMC_READY']   =  { 'gpio_pin': 'H2', 'direction': 'out' }
 GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
 GPIO_CONFIG['PCIE_RESET']   = { 'gpio_pin': 'B5', 'direction': 'out' }
 GPIO_CONFIG['USB_RESET']    = { 'gpio_pin': 'B6', 'direction': 'out' }
+GPIO_CONFIG['BEEP']    	  =   { 'gpio_pin': 'N7', 'direction': 'out' }
 GPIO_CONFIG['SLOT0_RISER_PRESENT'] =   { 'gpio_pin': 'N0', 'direction': 'in' }
 GPIO_CONFIG['SLOT1_RISER_PRESENT'] =   { 'gpio_pin': 'N1', 'direction': 'in' }
 GPIO_CONFIG['SLOT2_RISER_PRESENT'] =   { 'gpio_pin': 'N2', 'direction': 'in' }
diff --git a/objects/led_controller.c b/objects/led_controller.c
old mode 100644
new mode 100755
index 8c3fa3c..5bb4542
--- a/objects/led_controller.c
+++ b/objects/led_controller.c
@@ -10,11 +10,12 @@ static const gchar* dbus_name        = "org.openbmc.control.led";
 
 static GDBusObjectManagerServer *manager = NULL;
 
-#define  NUM_GPIO 2
+#define  NUM_GPIO 3
 
 GPIO led_gpio[NUM_GPIO] = { 
 	(GPIO){"IDENTIFY"},
-	(GPIO){"BMC_READY"}
+	(GPIO){"BMC_READY"},
+	(GPIO){"BEEP"}
 };
 
 
@@ -67,21 +68,30 @@ on_set_off       (Led          *led,
 	return TRUE;
 }
 
+int tmp=0;
 void init_led(Led* led, GPIO* mygpio)
 {
 	int rc = GPIO_OK;
+	int i=5;
+	tmp++;
 	do {
 		uint8_t val;
 		rc = gpio_open(mygpio);
 		if (rc != GPIO_OK) { break; }
 		rc = gpio_read(mygpio,&val);
 		if (rc != GPIO_OK) { break; }
+		led_set_state(led,"off");
 		if (val == 0) {
 			led_set_state(led,"on");
 		} else {
 			led_set_state(led,"off");
 		}
-	} while(0);
+	i--;
+	} while(i!=0);
+	
+if(tmp==3)
+	led_set_state(led,"off");
+
 	gpio_close(mygpio);
 	if (rc != GPIO_OK) {
 		g_print("ERROR led controller: GPIO error %s (rc=%d)\n",
-- 
2.6.3

  parent reply	other threads:[~2015-11-20  1:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  1:00 [PATCH skeleton v3 00/19] Set default LED status, add GPIO define OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 01/19] LED test OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 02/19] LED test 2 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 03/19] LED test3 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 04/19] Remove ; OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 05/19] Force fan duty to 100% OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 06/19] Workarounf for fan PWM 100% OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 07/19] Remove git 1e751075d5a11736df67c40ead5a8375141269d3 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 08/19] Set default LED status, add GPIO define OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 09/19] Init BMC_THROTTLE GPIO to high OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 10/19] add bmc flash capability OpenBMC Patches
2015-11-20  1:00 ` OpenBMC Patches [this message]
2015-11-20  1:00 ` [PATCH skeleton v3 12/19] LED test 2 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 13/19] LED test3 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 14/19] Remove ; OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 15/19] Force fan duty to 100% OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 16/19] Workarounf for fan PWM 100% OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 17/19] Remove git 1e751075d5a11736df67c40ead5a8375141269d3 OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 18/19] Set default LED status, add GPIO define OpenBMC Patches
2015-11-20  1:00 ` [PATCH skeleton v3 19/19] Init BMC_THROTTLE GPIO to high OpenBMC Patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447981233-5573-12-git-send-email-openbmc-patches@stwcx.xyz \
    --to=openbmc-patches@stwcx.xyz \
    --cc=ken.sk.lai@mail.foxconn.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.