desktop_animation.c 805 B

12345678910111213141516171819202122232425262728
  1. #include "desktop_animation.h"
  2. #define TAG "DesktopAnimation"
  3. static const Icon* idle_scenes[] = {&A_Wink_128x64, &A_WatchingTV_128x64};
  4. const Icon* desktop_get_icon() {
  5. uint8_t new = 0;
  6. #if 0
  7. // checking dolphin state here to choose appropriate animation
  8. Dolphin* dolphin = furi_record_open("dolphin");
  9. DolphinStats stats = dolphin_stats(dolphin);
  10. float timediff = fabs(difftime(stats.timestamp, dolphin_state_timestamp()));
  11. FURI_LOG_I(TAG, "background change");
  12. FURI_LOG_I(TAG, "icounter: %d", stats.icounter);
  13. FURI_LOG_I(TAG, "butthurt: %d", stats.butthurt);
  14. FURI_LOG_I(TAG, "time since deeed: %.0f", timediff);
  15. #endif
  16. if((random() % 100) > 50) { // temp rnd selection
  17. new = random() % COUNT_OF(idle_scenes);
  18. }
  19. return idle_scenes[new];
  20. }