Commit Graph

6 Commits

Author SHA1 Message Date
Nikita Malyavin
bb5fbcc2f9 orientation: Correct handling of orientation on threshold
The old code gave a priority to portrait orientation, so that if
rotation reached the portrait threshold, it switched straight away.

This is problematic if the device you're dealing with isn't a mostly
portrait phone, but a tablet that can be used in both orientations
equally.

Landscape thresholds and portrait thresholds can (and they do) overlap.
In the overlapping area we should try to keep the previous orientation
until that threshold has passed.

[Bastien Nocera: Added test change]
2019-09-04 18:11:45 +02:00
Bastien Nocera
35b6328cbd orientation: Fix orientation calculations to match Windows 10
This fixes the new test-orientation test case.
2016-12-01 16:28:13 +01:00
Bastien Nocera
07299fb51b accel: Fix accelerometer unit confusion
The original orientation code was based upon code that expected 1G to
roughly correspond to a reading of 256, to work-around the fact that the
input layer could not pass fractional values easily.

So the orientation_calc() code expected that too. But IIO readings after
scaling are properly in m/s², and our readings are integers.

We'll pass the scaling around to be applied at the last minute, when
doing calculations.

Closes: #100
2016-09-14 14:12:01 +02:00
Bastien Nocera
6d2fff6c10 COPYING: Clarify GPL v3 license
Closes #26
2015-05-27 11:13:46 +02:00
Bastien Nocera
8fd1a46c8d main: Update copyright headers
And remove documentation from it, it should all be in the newly added
docs.
2015-05-20 10:44:52 +02:00
Bastien Nocera
4cfe39899a build: Add missing files and headers
Closes #9
2015-03-07 14:55:07 +01:00