[FL-2163] CLI: Separate session from CLI service (#1130)

* CLI: session refactoring
* Added forgotten define
* Desktop lock state save
* Dolphin: use proper type for value returned by dolphin_state_xp_to_levelup

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-04-29 15:02:17 +03:00
committed by GitHub
parent 76221021ec
commit 0eac917f91
20 changed files with 348 additions and 243 deletions

View File

@@ -148,7 +148,7 @@ void dolphin_state_on_deed(DolphinState* dolphin_state, DolphinDeed deed) {
dolphin_deed_get_app_limit(app) - dolphin_state->data.icounter_daily_limit[app];
uint8_t deed_weight = CLAMP(dolphin_deed_get_weight(deed), weight_limit, 0);
uint8_t xp_to_levelup = dolphin_state_xp_to_levelup(dolphin_state->data.icounter);
uint32_t xp_to_levelup = dolphin_state_xp_to_levelup(dolphin_state->data.icounter);
if(xp_to_levelup) {
deed_weight = MIN(xp_to_levelup, deed_weight);
dolphin_state->data.icounter += deed_weight;