Cosimo Cecchi
4fff41f15d
Add more debug output
2014-07-26 16:31:57 +02:00
Bastien Nocera
3d1ba0ec3f
main: Increase the threshold necessary for switching to portrait
...
20 degrees made a slightly tilted (laptop, raise one knee) switch
to portrait mode too quickly.
2014-07-23 18:43:46 +02:00
Bastien Nocera
6e07a398ba
main: Fix warning if permissions are missing
2014-07-23 18:08:29 +02:00
Bastien Nocera
db78d1a121
main: Really exit when the sensor disappears
...
When the sensor disappears, we only stopped polling the accelerometer
for new values. This wasn't enough to actually exit cleanly.
2014-07-21 13:08:13 +02:00
Bastien Nocera
2df0afc5a1
main: Fix possible crash when sensor disappears
...
When the sensor disappears, we get a read error within the
prepare_output() callback. But as we assign the retval of that function
to an OrientationUp value, we lose the signedness and never see the
error.
Instead, assign the retval to an integer that we can check correctly,
and only assign to an OrientationUp value once we've checked for errors.
2014-07-21 13:04:46 +02:00
Bastien Nocera
f5f2d20f7e
main: Remove dead debug code
2014-07-10 00:12:06 +02:00
Bastien Nocera
6ea3d7a5ba
main: Replace printf warning by g_warning
2014-07-10 00:12:06 +02:00
Bastien Nocera
6e909754cc
main: Setup ring buffer and trigger on startup
...
This shouldn't be something we need to do for every loop, so
only do that on startup, and tear down on exit.
2014-07-10 00:12:06 +02:00
Bastien Nocera
b9b455ec12
main: Comment unused debug function
...
string_to_orientation() is unused for now.
2014-07-10 00:12:06 +02:00
Bastien Nocera
9d7eca4470
main: Don't create the device path in the loop
...
There's no need to do this in each and every loop, the device
path doesn't change from one loop to another.
2014-07-10 00:12:06 +02:00
Bastien Nocera
625b439789
main: Scan size never changes, so calculate it once
...
As the channels never change, the scan size never changes either,
so calculate it at the beginning of the program, and reuse that
value.
2014-07-10 00:12:06 +02:00
Bastien Nocera
e868255342
main: Make read timeout longer
...
We're targetting to have the device change orientation after being
in the same position for 800 msecs by default, to avoid mid-flight
changes.
So we don't need to check more often than every 800 msecs. Shave
about 100 msecs for the processing of the information.
2014-07-10 00:12:06 +02:00
Bastien Nocera
1e5dd2b6ef
iio-sensor-proxy
2014-07-09 12:28:25 +02:00