Resetting the lap counter when a new name is recived
[apps/native/gear-racing-car.git] / src / app.c
index b645682..5c6a593 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -31,7 +31,6 @@
 #include "controller_connection_manager.h"
 #include "lap_counter/lap_counter.h"
 #include "command.h"
-#include "lap_counter/lap_counter.h"
 
 #define ENABLE_MOTOR 1
 #define STERING_SERVO_CENTER 340
@@ -168,8 +167,11 @@ static void __command_received_cb(command_s command) {
        }
 }
 
-static void __user_name_received_cb(const char *name) {
+static void __user_name_received_cb(const char *name)
+{
+       _D("User name received: %s", name);
        lap_counter_set_user_name(name);
+       lap_counter_set_start_lap();
 }
 
 static void _initialize_config()