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

@@ -0,0 +1,66 @@
/**
* @file shake_emotion.h
* @brief Shaking animation controller
*
* Manages the shaking Lottie animation that plays when the device
* is being continuously shaken, and the shake-stop transition animation.
*/
#ifndef SHAKE_EMOTION_H
#define SHAKE_EMOTION_H
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Initialize the shake emotion module
*
* @return true on success, false on failure
*/
bool shakeEmotionInit(void);
/**
* @brief Start playing the shaking animation
*
* Animation will loop until shakeEmotionBeginStop() is called.
*/
void shakeEmotionPlay(void);
/**
* @brief Begin stopping the shake animation
*
* Finishes the current shaking loop, then plays the shake-stop transition.
* Call shakeEmotionUpdate() to poll for completion.
*/
void shakeEmotionBeginStop(void);
/**
* @brief Update the shake stop transition
*
* Must be called periodically to complete the shake-stop transition.
*
* @return true if transition is complete and ready for idle, false if still
* transitioning
*/
bool shakeEmotionUpdate(void);
/**
* @brief Stop the shaking animation immediately (for cleanup)
*/
void shakeEmotionStop(void);
/**
* @brief Check if shaking animation is currently playing
*
* @return true if playing, false otherwise
*/
bool shakeEmotionIsPlaying(void);
#ifdef __cplusplus
}
#endif
#endif // SHAKE_EMOTION_H