-namespace {
-
-double map_controller_to_float(int val)
-{
- // Slightly hackish mapping so that we can represent exactly 0.0, 0.5 and 1.0.
- if (val <= 0) {
- return 0.0;
- } else if (val >= 127) {
- return 1.0;
- } else {
- return (val + 0.5) / 127.0;
- }
-}
-
-} // namespace
-