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]
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