main: Add artificial delay before starting daemon

The IIO core, or the HID layer for HID sensor hubs, seems not
to like being poked straight after waking up, so add an
artificial delay during startup.

This is similar to the work-arounds doing the rounds in the
iio-sensor-proxy issues that switch the service type to idle
which would add a delay of up to 5 seconds by waiting for
other daemons to have finished startup.

This will need a real fix in the kernel at some point.
This commit is contained in:
Bastien Nocera
2016-11-22 14:09:01 +01:00
parent d71d4342e4
commit 5468452f7a

View File

@@ -768,6 +768,8 @@ int main (int argc, char **argv)
/* g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); */
g_usleep (G_USEC_PER_SEC * 3);
data = g_new0 (SensorData, 1);
data->previous_orientation = ORIENTATION_UNDEFINED;
data->uses_lux = TRUE;