--- /dev/null
+/* ============================================================================
+ Copyright (C) 2010 nomrasco
+ Nom Rasco <nomrasco@gmail.com>
+
+ This file is part of libnomaccel.
+
+ libnomaccel is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ libnomaccel is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libnomaccel. If not, see <http://www.gnu.org/licenses/>.
+============================================================================ */
+#include "global_p.h"
+#include <stdlib.h>
+
+void
+_nom_accel_proxy_init ()
+{
+ _accel_proxy.x = 0;
+ _accel_proxy.y = 0;
+ _accel_proxy.z = 0;
+ _accel_proxy.pitch = 0.0;
+ _accel_proxy.roll = 0.0;
+}
+
+void
+_accel_proxy_finit ()
+{
+ /* nothing to do yet */
+}
+
+void
+_accel_read_real_values ()
+{
+ FILE* fd;
+ fd = fopen(_accel_device_file_name, "r");
+ if(0 == fd) return;
+ fscanf ( fd, "%i %i %i",
+ &_accel_proxy.x,
+ &_accel_proxy.y,
+ &_accel_proxy.z );
+ fclose(fd);
+}
+
+void
+_accel_recalculate_pitch () {
+ _accel_proxy.pitch = YZ_TO_PITCH(_accel_proxy.y, _accel_proxy.z);
+}
+
+void
+_accel_recalculate_roll () {
+ _accel_proxy.roll = XY_TO_ROLL(_accel_proxy.x, _accel_proxy.y);
+}
+
+