summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 30d36c4..9a693f6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -317,6 +317,8 @@ static void _initialize_components(app_data *ad)
message_manager_init();
controller_connection_manager_listen();
lap_counter_init();
+ resource_led_init();
+
_D("Car settings: Stering[%d +/- %d] Engine[%d - %d], CamAzimuth[%d +/- %d], CamElev[%d - %d]",
s_info.stering_center, s_info.stering_range,
@@ -366,6 +368,8 @@ static bool service_app_create(void *data)
controller_connection_manager_set_command_received_cb(__command_received_cb);
controller_connection_manager_set_user_name_received_cb(__user_name_received_cb);
+ resource_led_set(LED_COLOR_RED);
+
return true;
}
@@ -387,12 +391,14 @@ static void service_app_control(app_control_h app_control, void *data)
static void service_app_terminate(void *data)
{
app_data *ad = data;
+ resource_led_set(LED_COLOR_NONE);
resource_set_servo_motor_value(s_info.stering_pin, STERING_SERVO_CENTER);
resource_set_servo_motor_value(s_info.elevation_pin, ELEVATION_MIN);
resource_set_servo_motor_value(s_info.azimuth_pin, (AZIMUTH_MIN + AZIMUTH_MAX) / 2);
resource_lap_counter_destroy();
+ resource_led_destroy();
if (ad->idle_h)
g_source_remove(ad->idle_h);