This commit is contained in:
Willy-JL
2023-11-12 02:20:45 +00:00
498 changed files with 4821 additions and 2206 deletions

View File

@@ -2,7 +2,6 @@
#include <stdint.h>
#include <furi.h>
#include <furi_hal.h>
#include <portmacro.h>
#include <dolphin/dolphin.h>
#include <power/power_service/power.h>
#include <storage/storage.h>
@@ -477,13 +476,13 @@ void animation_manager_unload_and_stall_animation(AnimationManager* animation_ma
animation_manager->state = AnimationManagerStateFreezedIdle;
animation_manager->freezed_animation_time_left =
xTimerGetExpiryTime(animation_manager->idle_animation_timer) - xTaskGetTickCount();
furi_timer_get_expire_time(animation_manager->idle_animation_timer) - furi_get_tick();
if(animation_manager->freezed_animation_time_left < 0) {
animation_manager->freezed_animation_time_left = 0;
}
furi_timer_stop(animation_manager->idle_animation_timer);
} else {
furi_assert(0);
furi_crash();
}
FURI_LOG_I(
@@ -561,7 +560,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
}
} else {
/* Unknown state is an error. But not in release version.*/
furi_assert(0);
furi_crash();
}
/* if can't restore previous animation - select new */

View File

@@ -334,7 +334,7 @@ static bool animation_storage_load_frames(
if(file_info.size > max_filesize) {
FURI_LOG_E(
TAG,
"Filesize %lld, max: %d (width %d, height %d)",
"Filesize %llu, max: %zu (width %u, height %u)",
file_info.size,
max_filesize,
width,
@@ -359,7 +359,7 @@ static bool animation_storage_load_frames(
if(!frames_ok) {
FURI_LOG_E(
TAG,
"Load \'%s\' failed, %dx%d, size: %lld",
"Load \'%s\' failed, %ux%u, size: %llu",
furi_string_get_cstr(filename),
width,
height,

View File

@@ -23,7 +23,7 @@ typedef struct {
uint8_t active_bubbles;
uint8_t passive_bubbles;
uint8_t active_shift;
TickType_t active_ended_at;
uint32_t active_ended_at;
Icon* freeze_frame;
} BubbleAnimationViewModel;
@@ -154,7 +154,7 @@ static void bubble_animation_activate(BubbleAnimationView* view, bool force) {
if(model->current != NULL) {
if(!force) {
if((model->active_ended_at + model->current->active_cooldown * 1000) >
xTaskGetTickCount()) {
furi_get_tick()) {
activate = false;
} else if(model->active_shift) {
activate = false;
@@ -215,7 +215,7 @@ static void bubble_animation_next_frame(BubbleAnimationViewModel* model) {
model->active_cycle = 0;
model->current_frame = 0;
model->current_bubble = bubble_animation_pick_bubble(model, false);
model->active_ended_at = xTaskGetTickCount();
model->active_ended_at = furi_get_tick();
}
if(model->current_bubble) {
@@ -355,7 +355,7 @@ void bubble_animation_view_set_animation(
furi_assert(model);
model->current = new_animation;
model->active_ended_at = xTaskGetTickCount() - (model->current->active_cooldown * 1000);
model->active_ended_at = furi_get_tick() - (model->current->active_cooldown * 1000);
model->active_bubbles = 0;
model->passive_bubbles = 0;
for(int i = 0; i < new_animation->frame_bubble_sequences_count; ++i) {

View File

@@ -1,7 +1,6 @@
#include "one_shot_animation_view.h"
#include <furi.h>
#include <portmacro.h>
#include <gui/canvas.h>
#include <gui/view.h>
#include <gui/icon_i.h>
@@ -11,7 +10,7 @@ typedef void (*OneShotInteractCallback)(void*);
struct OneShotView {
View* view;
TimerHandle_t update_timer;
FuriTimer* update_timer;
OneShotInteractCallback interact_callback;
void* interact_callback_context;
};
@@ -22,8 +21,8 @@ typedef struct {
bool block_input;
} OneShotViewModel;
static void one_shot_view_update_timer_callback(TimerHandle_t xTimer) {
OneShotView* view = (void*)pvTimerGetTimerID(xTimer);
static void one_shot_view_update_timer_callback(void* context) {
OneShotView* view = context;
OneShotViewModel* model = view_get_model(view->view);
if((model->index + 1) < model->icon->frame_count) {
@@ -81,7 +80,7 @@ OneShotView* one_shot_view_alloc(void) {
OneShotView* view = malloc(sizeof(OneShotView));
view->view = view_alloc();
view->update_timer =
xTimerCreate(NULL, 1000, pdTRUE, view, one_shot_view_update_timer_callback);
furi_timer_alloc(one_shot_view_update_timer_callback, FuriTimerTypePeriodic, view);
view_allocate_model(view->view, ViewModelTypeLocking, sizeof(OneShotViewModel));
view_set_context(view->view, view);
@@ -94,7 +93,7 @@ OneShotView* one_shot_view_alloc(void) {
void one_shot_view_free(OneShotView* view) {
furi_assert(view);
xTimerDelete(view->update_timer, portMAX_DELAY);
furi_timer_free(view->update_timer);
view_free(view->view);
view->view = NULL;
free(view);
@@ -120,7 +119,7 @@ void one_shot_view_start_animation(OneShotView* view, const Icon* icon) {
model->icon = icon;
model->block_input = true;
view_commit_model(view->view, true);
xTimerChangePeriod(view->update_timer, 1000 / model->icon->frame_rate, portMAX_DELAY);
furi_timer_start(view->update_timer, 1000 / model->icon->frame_rate);
}
View* one_shot_view_get_view(OneShotView* view) {