projects
/
speedometer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup
[speedometer]
/
util.c
diff --git
a/util.c
b/util.c
index
b53b8aa
..
0cda59d
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-16,6
+16,7
@@
along with this program. If not, see <http://www.gnu.org/licenses/>.
****/
along with this program. If not, see <http://www.gnu.org/licenses/>.
****/
+#include <math.h>
#include <location/location-gps-device.h>
#include <location/location-gpsd-control.h>
#include <location/location-gps-device.h>
#include <location/location-gpsd-control.h>
@@
-24,24
+25,26
@@
#include "callbacks.h"
#include "ui.h"
#include "callbacks.h"
#include "ui.h"
-static LocationGPSDevice *device = NULL;
-static LocationGPSDControl *control = NULL;
+#ifdef __arm__
+ static LocationGPSDevice *device = NULL;
+ static LocationGPSDControl *control = NULL;
+#endif
-void start_gps(AppData* appdata) {
+void start_gps() {
#ifdef __arm__
if(!device) {
device = g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
#ifdef __arm__
if(!device) {
device = g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
- g_signal_connect(device, "changed", G_CALLBACK(location_changed), appdata);
+ g_signal_connect(device, "changed", G_CALLBACK(location_changed), NULL);
}
control = location_gpsd_control_get_default();
location_gpsd_control_request_status(control);
if(control->can_control) {
location_gpsd_control_start(control);
}
control = location_gpsd_control_get_default();
location_gpsd_control_request_status(control);
if(control->can_control) {
location_gpsd_control_start(control);
- }
+ }
#endif // __arm__
}
#endif // __arm__
}
-void stop_gps(AppData* appdata) {
+void stop_gps() {
#ifdef __arm__
control = location_gpsd_control_get_default();
location_gpsd_control_request_status(control);
#ifdef __arm__
control = location_gpsd_control_get_default();
location_gpsd_control_request_status(control);
@@
-51,21
+54,9
@@
void stop_gps(AppData* appdata) {
#endif // __arm__
}
#endif // __arm__
}
-void interpret_speed_from_gps(AppData* appdata, gdouble speed) {
-
- // first let's convert the number to characters
- gchar* c_digits = calloc(30, 1);
-
- g_sprintf(c_digits, "%f", speed);
+/* Loads the settings from GConf
+ *
+ */
+void load_settings() {
- g_print("interpret_speed_from_gps: %s", c_digits);
-
- int i = 0;
- while(i < 3) {
- guint value = g_ascii_digit_value(c_digits[i]);
- set_nth_digit(appdata, i, value);
- i++;
- }
- g_free(c_digits);
}
}
-