Lap counter peripheral added
[apps/native/gear-racing-car.git] / src / app.c
index 03e3e95..0092caf 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -212,6 +212,12 @@ static bool service_app_create(void *data)
        int ret = 0;
        app_data *ad = data;
 
+       _D("-----------------------=======================================================================-----------------------");
+       _D("-----------------------=======================================================================-----------------------");
+       _D("-----------------------============================== APP %s %s ==============================-----------------------", __DATE__, __TIME__);
+       _D("-----------------------=======================================================================-----------------------");
+       _D("-----------------------=======================================================================-----------------------");
+
        /*
         * if you want to use default configuration,
         * Do not need to call resource_set_motor_driver_L298N_configuration(),
@@ -230,6 +236,8 @@ static bool service_app_create(void *data)
        }
 #endif
 
+       resource_lap_counter_init();
+
        _initialize_components(ad);
        cloud_communication_start(CLOUD_REQUESTS_FREQUENCY);
 
@@ -262,6 +270,8 @@ static void service_app_terminate(void *data)
        resource_set_servo_motor_value(ELEVATION_SERVO_PIN, ELEVATION_MIN);
        resource_set_servo_motor_value(AZIMUTH_SERVO_PIN, (AZIMUTH_MIN + AZIMUTH_MAX) / 2);
 
+       resource_lap_counter_destroy();
+
        if (ad->idle_h)
                g_source_remove(ad->idle_h);