Refactor project structure and update display logic
Reorganized source files into new directories for config, drivers, sensors, emotion engine, and UI. Removed legacy assets and code related to previous eye animation implementation. Added new display and touch drivers, emotion manager, shake detector, and UI components. Updated CMake project name to 'irobot_display'.
This commit is contained in:
54
main/ui/splash_screen.c
Normal file
54
main/ui/splash_screen.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @file splash_screen.c
|
||||
* @brief Splash screen implementation for LVGL
|
||||
*
|
||||
* Displays the company logo on startup for a configured duration.
|
||||
* The implementation creates a temporary screen, renders the logo,
|
||||
* and then cleans up to prepare for the main application UI.
|
||||
*/
|
||||
|
||||
#include "ui/splash_screen.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "lvgl.h"
|
||||
|
||||
#include "ui/assets/splash_screen/logo_iro.h"
|
||||
|
||||
static const char *TAG = "splash_screen";
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Public API Implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void splashScreenShow(void) {
|
||||
ESP_LOGI(TAG, "Showing splash screen");
|
||||
|
||||
// Create a temporary screen for the splash
|
||||
lv_obj_t *splashScreen = lv_obj_create(NULL);
|
||||
lv_obj_set_style_bg_color(splashScreen, lv_color_black(),
|
||||
LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(splashScreen, LV_OPA_COVER,
|
||||
LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
// Create and center the logo image
|
||||
lv_obj_t *logoImage = lv_img_create(splashScreen);
|
||||
lv_img_set_src(logoImage, &logoIro);
|
||||
lv_obj_center(logoImage);
|
||||
|
||||
// Activate the splash screen
|
||||
lv_scr_load(splashScreen);
|
||||
lv_refr_now(NULL);
|
||||
|
||||
ESP_LOGI(TAG, "Splash screen displayed, waiting %d ms",
|
||||
SPLASH_SCREEN_DURATION_MS);
|
||||
|
||||
// Block for the display duration
|
||||
vTaskDelay(pdMS_TO_TICKS(SPLASH_SCREEN_DURATION_MS));
|
||||
|
||||
// Clean up the logo image before transitioning
|
||||
lv_obj_del(logoImage);
|
||||
|
||||
ESP_LOGI(TAG, "Splash screen complete");
|
||||
}
|
||||
Reference in New Issue
Block a user