mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:58:36 -07:00
Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev
This commit is contained in:
@@ -23,7 +23,7 @@ void dolphin_deed(DolphinDeed deed) {
|
||||
}
|
||||
|
||||
DolphinStats dolphin_stats(Dolphin* dolphin) {
|
||||
furi_assert(dolphin);
|
||||
furi_check(dolphin);
|
||||
|
||||
DolphinStats stats;
|
||||
DolphinEvent event;
|
||||
@@ -37,7 +37,7 @@ DolphinStats dolphin_stats(Dolphin* dolphin) {
|
||||
}
|
||||
|
||||
void dolphin_flush(Dolphin* dolphin) {
|
||||
furi_assert(dolphin);
|
||||
furi_check(dolphin);
|
||||
|
||||
DolphinEvent event;
|
||||
event.type = DolphinEventTypeFlush;
|
||||
@@ -74,7 +74,7 @@ void dolphin_clear_limits_timer_callback(void* context) {
|
||||
dolphin_event_send_async(dolphin, &event);
|
||||
}
|
||||
|
||||
Dolphin* dolphin_alloc() {
|
||||
Dolphin* dolphin_alloc(void) {
|
||||
Dolphin* dolphin = malloc(sizeof(Dolphin));
|
||||
|
||||
dolphin->state = dolphin_state_alloc();
|
||||
@@ -120,6 +120,7 @@ void dolphin_event_release(Dolphin* dolphin, DolphinEvent* event) {
|
||||
}
|
||||
|
||||
FuriPubSub* dolphin_get_pubsub(Dolphin* dolphin) {
|
||||
furi_check(dolphin);
|
||||
return dolphin->pubsub;
|
||||
}
|
||||
|
||||
@@ -204,6 +205,8 @@ int32_t dolphin_srv(void* p) {
|
||||
}
|
||||
|
||||
void dolphin_upgrade_level(Dolphin* dolphin) {
|
||||
furi_check(dolphin);
|
||||
|
||||
dolphin_state_increase_level(dolphin->state);
|
||||
dolphin_flush(dolphin);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ struct Dolphin {
|
||||
FuriTimer* clear_limits_timer;
|
||||
};
|
||||
|
||||
Dolphin* dolphin_alloc();
|
||||
Dolphin* dolphin_alloc(void);
|
||||
|
||||
void dolphin_event_send_async(Dolphin* dolphin, DolphinEvent* event);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const uint32_t DOLPHIN_LEVELS[] = {100, 200, 300, 450, 600, 750, 950, 115
|
||||
5250, 5700, 6150, 6600, 7100, 7600, 8100, 8650, 9999};
|
||||
const size_t DOLPHIN_LEVEL_COUNT = COUNT_OF(DOLPHIN_LEVELS);
|
||||
|
||||
DolphinState* dolphin_state_alloc() {
|
||||
DolphinState* dolphin_state_alloc(void) {
|
||||
return malloc(sizeof(DolphinState));
|
||||
}
|
||||
|
||||
@@ -72,8 +72,10 @@ bool dolphin_state_load(DolphinState* dolphin_state) {
|
||||
return success;
|
||||
}
|
||||
|
||||
uint64_t dolphin_state_timestamp() {
|
||||
return furi_hal_rtc_get_timestamp();
|
||||
uint64_t dolphin_state_timestamp(void) {
|
||||
DateTime datetime;
|
||||
furi_hal_rtc_get_datetime(&datetime);
|
||||
return datetime_datetime_to_timestamp(&datetime);
|
||||
}
|
||||
|
||||
bool dolphin_state_is_levelup(uint32_t icounter) {
|
||||
|
||||
@@ -33,7 +33,7 @@ struct DolphinState {
|
||||
bool dirty;
|
||||
};
|
||||
|
||||
DolphinState* dolphin_state_alloc();
|
||||
DolphinState* dolphin_state_alloc(void);
|
||||
|
||||
void dolphin_state_free(DolphinState* dolphin_state);
|
||||
|
||||
@@ -43,7 +43,7 @@ bool dolphin_state_load(DolphinState* dolphin_state);
|
||||
|
||||
void dolphin_state_clear_limits(DolphinState* dolphin_state);
|
||||
|
||||
uint64_t dolphin_state_timestamp();
|
||||
uint64_t dolphin_state_timestamp(void);
|
||||
|
||||
void dolphin_state_on_deed(DolphinState* dolphin_state, DolphinDeed deed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user