X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=entry.c;h=baa80179823bbef610e29034b4c35a9d6a6b533a;hb=90721704d94145940f98960f4f1c70e62f5747e2;hp=e84e18d5fd72288d8dcb2162565916426ffe4f30;hpb=1fdbe72d79c73c936f7ebcc4f36ac2db12a6e742;p=android-x86%2Fhardware-intel-libsensors.git diff --git a/entry.c b/entry.c index e84e18d..baa8017 100644 --- a/entry.c +++ b/entry.c @@ -27,17 +27,18 @@ static int activate (__attribute__((unused)) struct sensors_poll_device_t* dev, * a workaround for this behavior. We set the initial sampling rate to * 10 events per second when the sensor is enabled for the first time. */ + if (enabled && sensor_get_quirks(handle) & QUIRK_INITIAL_RATE) { ALOGI("Forcing initial sampling rate\n"); - sensor_activate(handle, 1); + sensor_activate(handle, 1, 0); sensor_set_delay(handle, 100000000L); /* Start with 100 ms */ - sensor_activate(handle, 0); + sensor_activate(handle, 0, 0); /* Clear flag for this sensor as do this only once */ - sensor_info[handle].quirks ^= QUIRK_INITIAL_RATE; + sensor[handle].quirks ^= QUIRK_INITIAL_RATE; } - return sensor_activate(handle, enabled); + return sensor_activate(handle, enabled, 0); }