OSDN Git Service

bigcore: Give more time for iio device detection
authorHuzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com>
Wed, 6 Mar 2013 14:44:22 +0000 (06:44 -0800)
committerMattias Pettersson <mattias.pettersson@intel.com>
Wed, 4 Dec 2013 14:13:12 +0000 (15:13 +0100)
Currently android framework checks if /sys/bus/iio/devices node
is created and sets sensor property based on it. The check is
performed in a for loop of ~1 sec.
Looks like for i2c based sensors it is taking more time for the
node to be created and hence setting of property fails.

Increase the loop time to ~5 sec max which gives enough time for
the node to be detected.

Issue: AXIA-2039
Change-Id: I1b33eae948482e9e6835918d61357cd6ba3d7b2b
Signed-off-by: Huzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com>
bigcore/libsensors/BoardConfig.cpp

index e110b5f..5e92105 100644 (file)
@@ -59,7 +59,7 @@ int BoardConfig::sensorListSize()
         }
     }
 
-    for (int i=0; i<50; i++) {
+    for (int i=0; i<250; i++) {
         num_files = 0;
         if ((dp = opendir("/sys/bus/iio/devices")) == NULL){
             usleep(20000);