Disable Debug card display for postcodes if no GPIO's.
Some platforms does not have GPIO pins for debug card display. It
will throw error and will not proceed furthur process. In this
case, postcode display and selector position related code can be
skipped to disabled the 7seg debug card display alone for
postcodes.
It will not affect other process like postcode display in dbus,
etc.
TESTED : Verified multi host postcodes are displaying in the dbus
for Facebook YosemiteV35 and YosemiteV2.
Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: Iaa0aeec394523e1d62037650439ac60dc2488a77
diff --git a/main.cpp b/main.cpp
index 94603d1..57897f9 100644
--- a/main.cpp
+++ b/main.cpp
@@ -176,7 +176,19 @@
}
bus.request_name(snoopDbus.c_str());
- reporters[0]->getSelectorPositionSignal(bus);
+
+ /* sevenSegmentLedEnabled flag is unset when GPIO pins are not there 7
+ seg display for fewer platforms. So, the code for postcode dispay and
+ Get Selector position can be skipped in those platforms.
+ */
+ if (sevenSegmentLedEnabled)
+ {
+ reporters[0]->getSelectorPositionSignal(bus);
+ }
+ else
+ {
+ reporters.clear();
+ }
}
catch (const std::exception& e)
{
@@ -187,7 +199,8 @@
ret = configGPIODirOutput();
if (ret < 0)
{
- fprintf(stderr, "Failed find the gpio line\n");
+ fprintf(stderr, "Failed find the gpio line. Cannot display postcodes "
+ "in seven segment display..\n");
}
while (true)