Add shake emotion with persistent state and calibration

Introduces a new shake emotion animation with a shake-stop transition, including embedded Lottie animation data and a state machine for emotion transitions. Adds a non-volatile storage (NVS) driver for persistent state management, including first-boot detection, boot count, and IMU calibration storage. Updates emotion manager and related headers to support new shake emotion states, and integrates new UI components for calibration and loading animations.
This commit is contained in:
2026-01-24 20:02:04 +05:30
parent 8aeaed8a15
commit 4d68a788ad
22 changed files with 5255 additions and 93 deletions

View File

@@ -27,6 +27,11 @@ void splashScreenShow(void) {
// Create a temporary screen for the splash
lv_obj_t *splashScreen = lv_obj_create(NULL);
if (splashScreen == NULL) {
ESP_LOGE(TAG, "Failed to create splash screen object");
return;
}
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,
@@ -34,6 +39,11 @@ void splashScreenShow(void) {
// Create and center the logo image
lv_obj_t *logoImage = lv_img_create(splashScreen);
if (logoImage == NULL) {
ESP_LOGE(TAG, "Failed to create logo image object");
lv_obj_del(splashScreen);
return;
}
lv_img_set_src(logoImage, &logoIro);
lv_obj_center(logoImage);
@@ -47,8 +57,27 @@ void splashScreenShow(void) {
// Block for the display duration
vTaskDelay(pdMS_TO_TICKS(SPLASH_SCREEN_DURATION_MS));
// Clean up the logo image before transitioning
lv_obj_del(logoImage);
// Create a new main screen for the application to use
lv_obj_t *mainScreen = lv_obj_create(NULL);
if (mainScreen == NULL) {
ESP_LOGE(TAG, "Failed to create main screen");
return;
}
ESP_LOGI(TAG, "Splash screen complete");
// Set black background for main screen
lv_obj_set_style_bg_color(mainScreen, lv_color_black(),
LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(mainScreen, LV_OPA_COVER,
LV_PART_MAIN | LV_STATE_DEFAULT);
// Switch to the main screen (this deactivates splash screen)
lv_scr_load(mainScreen);
// Force an immediate refresh to ensure the transition is complete
lv_refr_now(NULL);
// Now safe to delete the splash screen and its children
lv_obj_del(splashScreen);
ESP_LOGI(TAG, "Splash screen complete, main screen active");
}