summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]src/controller.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/src/controller.c b/src/controller.c
index ecca89f..b8d8985 100644..100755
--- a/src/controller.c
+++ b/src/controller.c
@@ -574,30 +574,6 @@ int _fini_master(app_data *ad)
}
#endif /* USE_ST_SDK */
-static void _stop_gathering(void *data)
-{
- app_data *ad = data;
- ret_if(!ad);
-
- if (ad->getter_timer) {
- ecore_timer_del(ad->getter_timer);
- ad->getter_timer = NULL;
- }
-}
-
-static void _start_gathering(void *data)
-{
- app_data *ad = data;
- ret_if(!ad);
-
- if (ad->getter_timer)
- ecore_timer_del(ad->getter_timer);
-
- ad->getter_timer = ecore_timer_add(TIMER_GATHER_INTERVAL, _get_motion_sensor_data, ad);
- if (!ad->getter_timer)
- _E("Failed to add a timer");
-}
-
static bool service_app_create(void *user_data)
{
#ifdef USE_ST_SDK
@@ -617,8 +593,16 @@ static bool service_app_create(void *user_data)
static void service_app_control(app_control_h app_control, void *user_data)
{
- _stop_gathering(user_data);
- _start_gathering(user_data);
+ app_data *ad = user_data;
+
+ if (ad->getter_timer)
+ ecore_timer_del(ad->getter_timer);
+
+ ad->getter_timer = ecore_timer_add(TIMER_GATHER_INTERVAL, _get_motion_sensor_data, ad);
+ if (!ad->getter_timer) {
+ _E("Failed to add getter timer");
+ return;
+ }
}
static void service_app_terminate(void *user_data)