Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev --nobuild

This commit is contained in:
Willy-JL
2024-05-15 02:13:07 +01:00
37 changed files with 371 additions and 77 deletions

View File

@@ -1059,3 +1059,35 @@ type: raw
frequency: 38000 frequency: 38000
duty_cycle: 0.330000 duty_cycle: 0.330000
data: 4400 4440 527 1630 527 552 526 1630 527 551 528 550 528 552 526 551 527 1631 526 551 528 551 528 551 527 1628 529 1630 527 550 528 551 528 551 527 551 528 1629 528 1631 526 551 527 1630 527 1630 527 553 525 1629 528 1630 527 1631 526 1630 527 1630 527 1630 527 1630 527 1629 528 1632 525 1630 527 1629 528 1656 501 1631 526 1630 527 1630 527 1631 526 1630 527 1630 527 1632 525 1629 528 1630 527 551 527 1629 528 551 527 1628 529 5233 4402 4441 526 552 526 1630 527 551 527 1630 527 1629 528 1630 527 1630 527 551 527 1631 526 1629 528 1630 527 551 527 551 527 1630 527 1628 529 1630 527 1631 526 553 525 550 528 1633 524 551 528 552 526 1630 527 552 526 578 500 550 528 552 526 552 526 552 526 552 527 552 526 550 529 552 526 556 522 550 528 552 526 552 527 551 528 552 527 554 525 550 528 553 525 553 526 552 526 1631 526 551 527 1657 500 550 529 data: 4400 4440 527 1630 527 552 526 1630 527 551 528 550 528 552 526 551 527 1631 526 551 528 551 528 551 527 1628 529 1630 527 550 528 551 528 551 527 551 528 1629 528 1631 526 551 527 1630 527 1630 527 553 525 1629 528 1630 527 1631 526 1630 527 1630 527 1630 527 1630 527 1629 528 1632 525 1630 527 1629 528 1656 501 1631 526 1630 527 1630 527 1631 526 1630 527 1630 527 1632 525 1629 528 1630 527 551 527 1629 528 551 527 1628 529 5233 4402 4441 526 552 526 1630 527 551 527 1630 527 1629 528 1630 527 1630 527 551 527 1631 526 1629 528 1630 527 551 527 551 527 1630 527 1628 529 1630 527 1631 526 553 525 550 528 1633 524 551 528 552 526 1630 527 552 526 578 500 550 528 552 526 552 526 552 526 552 527 552 526 550 529 552 526 556 522 550 528 552 526 552 527 551 528 552 527 554 525 550 528 553 525 553 526 552 526 1631 526 551 527 1657 500 550 529
#
# Model: Toshiba RAS-2518D
#
name: Dh
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4349 4437 549 1615 551 1614 551 1614 551 1617 549 531 550 530 551 1615 550 531 550 532 549 530 551 531 550 530 551 1615 550 1614 551 531 550 1615 551 529 552 531 550 530 551 533 548 530 551 530 551 1616 549 1615 550 1616 550 1615 550 1614 551 1616 550 1615 551 1615 550 531 550 531 550 530 551 529 552 530 551 530 551 529 552 530 551 531 550 1615 550 532 549 1615 550 1616 550 531 550 531 550 530 551 530 551 529 552 532 549 530 551 530 551 531 550 529 552 531 550 1615 551 530 551 530 551 530 551 531 550 530 551 531 550 530 551 531 550 531 550 531 550 1616 550 1618 547 532 549 529 552 530 551 1615 551 1615 550 5379 4350 4436 550 1616 549 1615 551 1614 552 1615 550 529 552 530 551 1614 552 530 551 529 552 531 550 531 550 531 550 1614 552 1614 551 530 551 1615 550 530 551 530 551 530 551 530 551 531 550 532 549 1616 549 1615 551 1614 552 1615 550 1614 551 1616 550 1614 552 1615 550 529 552 530 551 530 551 530 551 531 550 531 550 530 551 530 551 531 550 1615 550 530 551 1615 550 1615 551 530 551 530 551 530 551 530 551 530 551 530 551 529 552 530 551 531 550 532 549 530 551 1615 551 531 550 530 551 530 551 530 551 530 551 531 550 531 550 531 550 530 551 531 550 1615 551 1615 551 532 549 531 550 531 550 1616 549 1614 552
#
name: Cool_hi
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4350 4438 549 1615 551 1614 552 1616 549 1616 550 530 551 531 550 1615 551 530 551 529 552 531 550 530 551 531 550 1614 551 1616 550 531 550 1616 549 530 551 531 550 530 551 529 552 530 551 531 550 1616 549 1616 550 1616 549 1616 550 1615 551 1614 551 1614 552 1615 551 530 551 531 550 530 551 531 550 531 550 529 552 532 549 531 550 530 551 1613 552 530 551 531 550 529 552 532 549 530 551 530 551 531 550 531 550 530 551 530 551 530 551 531 550 530 551 531 550 531 550 1615 551 529 552 530 551 530 551 530 551 530 551 530 551 530 551 530 551 532 549 531 550 531 550 532 549 531 550 531 550 530 551 530 551 5132 4351 4435 552 1616 550 1615 550 1615 551 1613 553 531 550 530 551 1615 550 530 551 531 550 531 550 530 551 532 549 1616 550 1616 549 530 551 1615 551 530 551 531 550 530 551 530 551 530 551 531 550 1615 551 1615 551 1614 551 1615 550 1615 551 1615 550 1615 550 1616 550 530 551 530 551 531 550 532 549 530 551 530 551 531 550 531 550 531 550 1615 550 530 551 530 551 530 551 529 552 531 550 530 551 531 550 531 550 530 551 530 551 531 550 530 551 530 551 530 551 531 550 1616 550 530 551 529 552 530 551 531 550 532 549 530 551 530 551 529 552 531 550 529 552 530 551 530 551 531 550 531 550 529 552 531 550
#
name: Cool_lo
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4350 4436 550 1617 549 1615 550 1615 550 1617 548 530 551 531 550 1615 551 531 550 531 550 530 551 530 551 531 550 1614 552 1615 550 530 551 1614 551 531 550 531 550 531 550 529 552 532 549 530 551 1617 549 1616 549 1615 551 1619 547 1615 550 1615 550 1616 549 1616 550 530 551 531 550 530 551 530 551 531 550 530 551 529 552 529 552 530 551 1617 548 533 548 1615 551 1613 552 530 551 531 550 531 550 530 551 530 551 532 549 531 550 531 550 530 551 531 550 531 550 531 550 1615 551 531 550 531 550 532 549 531 550 530 551 531 550 533 548 531 550 530 551 1617 548 1616 549 530 551 531 550 532 549 532 549 532 549 5200 4349 4436 550 1615 551 1615 551 1615 550 1616 550 531 550 530 551 1615 551 531 550 530 551 530 551 530 551 530 551 1616 549 1615 551 530 551 1615 551 531 550 531 550 530 551 531 550 531 550 531 550 1615 551 1616 550 1616 550 1615 550 1617 548 1616 549 1616 550 1615 550 531 550 530 551 531 550 531 550 532 549 530 551 531 550 531 550 532 549 1616 550 531 550 1616 550 1615 550 531 550 530 551 531 550 531 550 531 550 531 550 531 550 532 549 532 549 531 550 532 549 531 550 1616 550 531 550 530 551 532 549 532 549 530 551 532 549 531 550 532 549 531 550 1616 549 1617 549 531 550 530 551 531 550 532 549 532 549
#
name: Heat_hi
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4350 4437 547 1618 548 1620 546 1620 546 1619 547 534 547 535 546 1619 547 534 547 536 545 536 545 535 546 535 546 1619 547 1620 545 534 523 1644 546 535 522 559 546 535 546 534 547 535 546 535 545 1620 546 1620 546 1620 546 1619 547 1619 546 1619 547 1620 545 1620 546 535 546 534 547 537 520 558 523 558 547 534 547 536 521 559 522 559 522 1644 546 535 546 535 522 560 545 536 521 559 522 559 522 558 523 559 522 560 521 559 522 559 522 560 521 559 522 561 520 1644 521 1645 520 559 522 559 522 559 522 559 522 559 522 560 521 560 521 560 521 561 520 559 522 560 521 559 522 559 522 559 522 1644 522 559 522 5341 4349 4439 520 1645 521 1645 521 1646 519 1645 521 560 521 561 520 1645 521 560 521 560 521 559 522 560 521 561 520 1646 520 1645 521 561 520 1645 521 561 520 560 521 560 521 560 521 560 521 561 520 1644 522 1644 522 1645 520 1645 521 1645 521 1645 520 1646 520 1644 522 561 520 560 521 560 521 561 520 560 521 561 520 561 520 561 520 560 521 1646 520 562 519 561 520 561 520 562 519 560 521 560 521 561 520 561 520 560 521 560 521 561 520 560 521 560 521 562 519 1646 520 1645 521 561 520 561 520 561 520 560 521 560 521 561 520 560 521 559 522 560 521 561 520 561 520 560 521 562 519 559 522 1645 521 561 520
#
name: Heat_lo
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4348 4439 520 1646 520 1646 520 1646 519 1646 520 561 520 561 520 1646 519 561 520 561 520 562 519 562 519 561 520 1646 520 1647 518 563 518 1646 519 562 519 561 520 561 520 562 519 562 519 561 520 1648 517 1647 519 1646 519 1647 519 1646 520 1646 520 1645 520 1647 519 561 520 561 520 562 519 562 519 562 519 562 519 561 520 562 519 561 520 1646 520 562 519 1647 518 1646 520 562 519 560 521 561 520 561 520 561 520 562 519 562 519 560 521 562 519 562 519 560 521 1646 520 1646 520 561 520 562 519 561 520 562 519 561 520 561 520 561 520 561 520 561 520 1647 518 1646 520 562 519 562 519 561 520 1646 520 561 520 5409 4348 4440 519 1645 521 1646 519 1645 521 1645 521 561 520 561 520 1644 522 561 520 561 520 561 520 560 521 562 519 1646 520 1646 520 562 519 1644 522 561 520 561 520 561 520 561 520 561 520 561 520 1646 520 1645 520 1646 520 1645 521 1646 520 1646 520 1644 522 1645 521 560 521 560 521 561 520 561 520 560 521 560 521 561 520 561 520 561 520 1645 521 562 519 1645 521 1645 520 561 520 562 519 561 520 561 520 561 520 560 521 560 521 560 521 560 521 561 520 560 521 1646 520 1646 520 561 520 560 521 559 522 560 521 561 520 561 520 560 521 560 521 560 521 1646 520 1645 520 561 520 560 521 560 521 1645 521 561 520

View File

@@ -138,7 +138,8 @@ void elements_multiline_text_aligned(
/** Draw multiline text /** Draw multiline text
* *
* @param canvas Canvas instance * @param canvas Canvas instance
* @param x, y top left corner coordinates * @param x top left corner coordinates
* @param y top left corner coordinates
* @param text string (possible multiline) * @param text string (possible multiline)
*/ */
void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* text); void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* text);
@@ -146,7 +147,8 @@ void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* t
/** Draw framed multiline text /** Draw framed multiline text
* *
* @param canvas Canvas instance * @param canvas Canvas instance
* @param x, y top left corner coordinates * @param x top left corner coordinates
* @param y top left corner coordinates
* @param text string (possible multiline) * @param text string (possible multiline)
*/ */
void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const char* text); void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const char* text);
@@ -154,8 +156,10 @@ void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const
/** Draw slightly rounded frame /** Draw slightly rounded frame
* *
* @param canvas Canvas instance * @param canvas Canvas instance
* @param x, y top left corner coordinates * @param x top left corner coordinates
* @param width, height size of frame * @param y top left corner coordinates
* @param width width of frame
* @param height height of frame
*/ */
void elements_slightly_rounded_frame( void elements_slightly_rounded_frame(
Canvas* canvas, Canvas* canvas,
@@ -167,8 +171,10 @@ void elements_slightly_rounded_frame(
/** Draw slightly rounded box /** Draw slightly rounded box
* *
* @param canvas Canvas instance * @param canvas Canvas instance
* @param x, y top left corner coordinates * @param x top left corner coordinates
* @param width, height size of box * @param y top left corner coordinates
* @param width height of box
* @param height height of box
*/ */
void elements_slightly_rounded_box( void elements_slightly_rounded_box(
Canvas* canvas, Canvas* canvas,
@@ -180,8 +186,10 @@ void elements_slightly_rounded_box(
/** Draw bold rounded frame /** Draw bold rounded frame
* *
* @param canvas Canvas instance * @param canvas Canvas instance
* @param x, y top left corner coordinates * @param x top left corner coordinates
* @param width, height size of frame * @param y top left corner coordinates
* @param width width of frame
* @param height height of frame
*/ */
void elements_bold_rounded_frame(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height); void elements_bold_rounded_frame(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);

View File

@@ -311,6 +311,26 @@ void submenu_add_lockable_item(
true); true);
} }
void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label) {
furi_check(submenu);
furi_check(label);
with_view_model(
submenu->view,
SubmenuModel * model,
{
SubmenuItemArray_it_t it;
for(SubmenuItemArray_it(it, model->items); !SubmenuItemArray_end_p(it);
SubmenuItemArray_next(it)) {
if(index == SubmenuItemArray_cref(it)->index) {
furi_string_set_str(SubmenuItemArray_cref(it)->label, label);
break;
}
}
},
true);
}
void submenu_reset(Submenu* submenu) { void submenu_reset(Submenu* submenu) {
furi_check(submenu); furi_check(submenu);
view_set_orientation(submenu->view, ViewOrientationHorizontal); view_set_orientation(submenu->view, ViewOrientationHorizontal);
@@ -328,6 +348,25 @@ void submenu_reset(Submenu* submenu) {
true); true);
} }
uint32_t submenu_get_selected_item(Submenu* submenu) {
furi_check(submenu);
uint32_t selected_item_index = 0;
with_view_model(
submenu->view,
SubmenuModel * model,
{
if(model->position < SubmenuItemArray_size(model->items)) {
const SubmenuItem* item = SubmenuItemArray_cget(model->items, model->position);
selected_item_index = item->index;
}
},
false);
return selected_item_index;
}
void submenu_set_selected_item(Submenu* submenu, uint32_t index) { void submenu_set_selected_item(Submenu* submenu, uint32_t index) {
furi_check(submenu); furi_check(submenu);
with_view_model( with_view_model(

View File

@@ -53,6 +53,14 @@ void submenu_add_item(
SubmenuItemCallback callback, SubmenuItemCallback callback,
void* callback_context); void* callback_context);
/** Change label of an existing item
*
* @param submenu Submenu instance
* @param index The index of the item
* @param label The new label
*/
void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label);
/** Add lockable item to submenu /** Add lockable item to submenu
* *
* @param submenu Submenu instance * @param submenu Submenu instance
@@ -79,10 +87,18 @@ void submenu_add_lockable_item(
*/ */
void submenu_reset(Submenu* submenu); void submenu_reset(Submenu* submenu);
/** Set submenu item selector /** Get submenu selected item index
* *
* @param submenu Submenu instance * @param submenu Submenu instance
* @param index The index *
* @return Index of the selected item
*/
uint32_t submenu_get_selected_item(Submenu* submenu);
/** Set submenu selected item by index
*
* @param submenu Submenu instance
* @param index The index of the selected item
*/ */
void submenu_set_selected_item(Submenu* submenu, uint32_t index); void submenu_set_selected_item(Submenu* submenu, uint32_t index);

View File

@@ -41,7 +41,7 @@ static DialogMessageButton about_screen_product(DialogsApp* dialogs, DialogMessa
static DialogMessageButton about_screen_address(DialogsApp* dialogs, DialogMessage* message) { static DialogMessageButton about_screen_address(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result; DialogMessageButton result;
const char* screen_text = "Flipper Devices Inc\n" const char* screen_text = "Flipper Devices Inc.\n"
"Suite B #551, 2803\n" "Suite B #551, 2803\n"
"Philadelphia Pike, Claymont\n" "Philadelphia Pike, Claymont\n"
"DE, USA 19703\n"; "DE, USA 19703\n";
@@ -56,7 +56,7 @@ static DialogMessageButton about_screen_compliance(DialogsApp* dialogs, DialogMe
DialogMessageButton result; DialogMessageButton result;
const char* screen_text = "For all compliance\n" const char* screen_text = "For all compliance\n"
"certificates please visit:\n" "certificates, please visit:\n"
"www.flipp.dev/compliance"; "www.flipp.dev/compliance";
dialog_message_set_text(message, screen_text, 0, 0, AlignLeft, AlignTop); dialog_message_set_text(message, screen_text, 0, 0, AlignLeft, AlignTop);
@@ -97,7 +97,7 @@ static DialogMessageButton about_screen_cert_china_0(DialogsApp* dialogs, Dialog
static DialogMessageButton about_screen_cert_china_1(DialogsApp* dialogs, DialogMessage* message) { static DialogMessageButton about_screen_cert_china_1(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result; DialogMessageButton result;
dialog_message_set_icon(message, &I_CertificationChina1_122x47, 3, 3); dialog_message_set_icon(message, &I_CertificationChina1_124x47, 3, 3);
dialog_message_set_text( dialog_message_set_text(
message, furi_hal_version_get_srrc_id(), 55, 11, AlignLeft, AlignBottom); message, furi_hal_version_get_srrc_id(), 55, 11, AlignLeft, AlignBottom);
result = dialog_message_show(dialogs, message); result = dialog_message_show(dialogs, message);
@@ -226,9 +226,11 @@ int32_t about_settings_app(void* p) {
int32_t ret = 0; int32_t ret = 0;
while(1) { while(1) {
if(screen_index >= COUNT_OF(about_screens) - 1) { if(screen_index >= COUNT_OF(about_screens) - 1) {
dialog_message_set_buttons(message, "Back", NULL, NULL); dialog_message_set_buttons(message, "Prev.", NULL, NULL);
} else if(screen_index == 0) {
dialog_message_set_buttons(message, NULL, NULL, "Next");
} else { } else {
dialog_message_set_buttons(message, "Back", NULL, "Next"); dialog_message_set_buttons(message, "Prev.", NULL, "Next");
} }
screen_result = about_screens[screen_index](dialogs, message); screen_result = about_screens[screen_index](dialogs, message);

View File

@@ -11,10 +11,10 @@ void bt_settings_scene_forget_dev_confirm_dialog_callback(DialogExResult result,
void bt_settings_scene_forget_dev_confirm_on_enter(void* context) { void bt_settings_scene_forget_dev_confirm_on_enter(void* context) {
BtSettingsApp* app = context; BtSettingsApp* app = context;
DialogEx* dialog = app->dialog; DialogEx* dialog = app->dialog;
dialog_ex_set_header(dialog, "Unpair All Devices?", 64, 3, AlignCenter, AlignTop); dialog_ex_set_header(dialog, "Unpair All Devices?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text( dialog_ex_set_text(
dialog, "All previous pairings\nwill be lost!", 64, 22, AlignCenter, AlignTop); dialog, "All previous pairings\nwill be lost!", 64, 14, AlignCenter, AlignTop);
dialog_ex_set_left_button_text(dialog, "Back"); dialog_ex_set_left_button_text(dialog, "Cancel");
dialog_ex_set_right_button_text(dialog, "Unpair"); dialog_ex_set_right_button_text(dialog, "Unpair");
dialog_ex_set_context(dialog, app); dialog_ex_set_context(dialog, app);
dialog_ex_set_result_callback(dialog, bt_settings_scene_forget_dev_confirm_dialog_callback); dialog_ex_set_result_callback(dialog, bt_settings_scene_forget_dev_confirm_dialog_callback);

View File

@@ -53,7 +53,7 @@ void bt_settings_scene_start_on_enter(void* context) {
variable_item_set_current_value_index(item, BtSettingOff); variable_item_set_current_value_index(item, BtSettingOff);
variable_item_set_current_value_text(item, bt_settings_text[BtSettingOff]); variable_item_set_current_value_text(item, bt_settings_text[BtSettingOff]);
} }
variable_item_list_add(var_item_list, "Forget All Paired Devices", 1, NULL, NULL); variable_item_list_add(var_item_list, "Unpair All Devices", 1, NULL, NULL);
variable_item_list_set_enter_callback( variable_item_list_set_enter_callback(
var_item_list, bt_settings_scene_start_var_list_enter_callback, app); var_item_list, bt_settings_scene_start_var_list_enter_callback, app);
} else { } else {

View File

@@ -147,6 +147,7 @@ void desktop_settings_app_free(DesktopSettingsApp* app) {
extern int32_t desktop_settings_app(void* p) { extern int32_t desktop_settings_app(void* p) {
DesktopSettingsApp* app = desktop_settings_app_alloc(); DesktopSettingsApp* app = desktop_settings_app_alloc();
if(p && (strcmp(p, DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG) == 0)) { if(p && (strcmp(p, DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG) == 0)) {
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppScenePinSetupHowto); scene_manager_next_scene(app->scene_manager, DesktopSettingsAppScenePinSetupHowto);
} else { } else {
@@ -154,9 +155,11 @@ extern int32_t desktop_settings_app(void* p) {
} }
view_dispatcher_run(app->view_dispatcher); view_dispatcher_run(app->view_dispatcher);
if(app->save_settings) { if(app->save_settings) {
DESKTOP_SETTINGS_SAVE(&app->desktop->settings); DESKTOP_SETTINGS_SAVE(&app->desktop->settings);
} }
desktop_settings_app_free(app); desktop_settings_app_free(app);
return 0; return 0;
} }

View File

@@ -37,8 +37,9 @@ extern const char* EXTRA_KEYBINDS[];
extern const size_t EXTRA_KEYBINDS_COUNT; extern const size_t EXTRA_KEYBINDS_COUNT;
typedef struct { typedef struct {
Gui* gui;
Desktop* desktop; Desktop* desktop;
Gui* gui;
DialogsApp* dialogs; DialogsApp* dialogs;
SceneManager* scene_manager; SceneManager* scene_manager;
ViewDispatcher* view_dispatcher; ViewDispatcher* view_dispatcher;
@@ -53,7 +54,7 @@ typedef struct {
PinCode pincode_buffer; PinCode pincode_buffer;
bool pincode_buffer_filled; bool pincode_buffer_filled;
uint8_t menu_idx; uint32_t pin_menu_idx;
bool save_settings; bool save_settings;
} DesktopSettingsApp; } DesktopSettingsApp;

View File

@@ -41,7 +41,7 @@ void desktop_settings_scene_pin_auth_on_enter(void* context) {
desktop_view_pin_input_set_label_button(app->pin_input_view, "OK"); desktop_view_pin_input_set_label_button(app->pin_input_view, "OK");
desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL); desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL);
desktop_view_pin_input_set_label_secondary( desktop_view_pin_input_set_label_secondary(
app->pin_input_view, 0, 8, "Enter Your Current PIN:"); app->pin_input_view, 0, 8, "Enter your current PIN:");
desktop_view_pin_input_reset_pin(app->pin_input_view); desktop_view_pin_input_reset_pin(app->pin_input_view);
desktop_view_pin_input_unlock_input(app->pin_input_view); desktop_view_pin_input_unlock_input(app->pin_input_view);
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput); view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput);

View File

@@ -35,7 +35,7 @@ void desktop_settings_scene_pin_error_on_enter(void* context) {
uint32_t state = uint32_t state =
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppScenePinError); scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppScenePinError);
if(state == SCENE_STATE_PIN_ERROR_MISMATCH) { if(state == SCENE_STATE_PIN_ERROR_MISMATCH) {
desktop_view_pin_input_set_label_primary(app->pin_input_view, 29, 8, "PIN Mismatch!"); desktop_view_pin_input_set_label_primary(app->pin_input_view, 29, 8, "PIN mismatch!");
} else if(state == SCENE_STATE_PIN_ERROR_WRONG) { } else if(state == SCENE_STATE_PIN_ERROR_WRONG) {
desktop_view_pin_input_set_label_primary(app->pin_input_view, 35, 8, "Wrong PIN!"); desktop_view_pin_input_set_label_primary(app->pin_input_view, 35, 8, "Wrong PIN!");
} else { } else {

View File

@@ -45,7 +45,7 @@ void desktop_settings_scene_pin_menu_on_enter(void* context) {
} }
submenu_set_header(app->submenu, "PIN Code Settings"); submenu_set_header(app->submenu, "PIN Code Settings");
submenu_set_selected_item(app->submenu, app->menu_idx); submenu_set_selected_item(app->submenu, app->pin_menu_idx);
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewMenu); view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewMenu);
} }
@@ -77,11 +77,16 @@ bool desktop_settings_scene_pin_menu_on_event(void* context, SceneManagerEvent e
consumed = true; consumed = true;
break; break;
} }
} else if(event.type == SceneManagerEventTypeBack) {
submenu_set_selected_item(app->submenu, 0);
} }
return consumed; return consumed;
} }
void desktop_settings_scene_pin_menu_on_exit(void* context) { void desktop_settings_scene_pin_menu_on_exit(void* context) {
DesktopSettingsApp* app = context; DesktopSettingsApp* app = context;
app->pin_menu_idx = submenu_get_selected_item(app->submenu);
submenu_reset(app->submenu); submenu_reset(app->submenu);
} }

View File

@@ -48,7 +48,7 @@ void desktop_settings_scene_pin_setup_on_enter(void* context) {
desktop_view_pin_input_set_label_button(app->pin_input_view, "OK"); desktop_view_pin_input_set_label_button(app->pin_input_view, "OK");
desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL); desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL);
desktop_view_pin_input_set_label_secondary( desktop_view_pin_input_set_label_secondary(
app->pin_input_view, 0, 8, "Enter From 4 To 10 Arrows:"); app->pin_input_view, 0, 8, "Enter from 4 to 10 arrows:");
desktop_view_pin_input_reset_pin(app->pin_input_view); desktop_view_pin_input_reset_pin(app->pin_input_view);
desktop_view_pin_input_unlock_input(app->pin_input_view); desktop_view_pin_input_unlock_input(app->pin_input_view);
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput); view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput);
@@ -64,7 +64,7 @@ bool desktop_settings_scene_pin_setup_on_event(void* context, SceneManagerEvent
desktop_view_pin_input_set_label_button(app->pin_input_view, "OK"); desktop_view_pin_input_set_label_button(app->pin_input_view, "OK");
desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL); desktop_view_pin_input_set_label_primary(app->pin_input_view, 0, 0, NULL);
desktop_view_pin_input_set_label_secondary( desktop_view_pin_input_set_label_secondary(
app->pin_input_view, 0, 8, "Confirm Your PIN:"); app->pin_input_view, 0, 8, "Confirm your PIN:");
desktop_view_pin_input_reset_pin(app->pin_input_view); desktop_view_pin_input_reset_pin(app->pin_input_view);
desktop_view_pin_input_unlock_input(app->pin_input_view); desktop_view_pin_input_unlock_input(app->pin_input_view);
consumed = true; consumed = true;
@@ -97,6 +97,7 @@ bool desktop_settings_scene_pin_setup_on_event(void* context, SceneManagerEvent
break; break;
} }
} }
return consumed; return consumed;
} }

View File

@@ -25,6 +25,7 @@ void desktop_settings_scene_pin_setup_done_on_enter(void* context) {
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION); NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
notification_message(notification, &sequence_single_vibro); notification_message(notification, &sequence_single_vibro);
notification_message(notification, &sequence_blink_green_10);
furi_record_close(RECORD_NOTIFICATION); furi_record_close(RECORD_NOTIFICATION);
desktop_view_pin_input_set_context(app->pin_input_view, app); desktop_view_pin_input_set_context(app->pin_input_view, app);
@@ -34,7 +35,7 @@ void desktop_settings_scene_pin_setup_done_on_enter(void* context) {
desktop_view_pin_input_set_label_button(app->pin_input_view, "Done"); desktop_view_pin_input_set_label_button(app->pin_input_view, "Done");
desktop_view_pin_input_set_label_primary(app->pin_input_view, 29, 8, "PIN Activated!"); desktop_view_pin_input_set_label_primary(app->pin_input_view, 29, 8, "PIN Activated!");
desktop_view_pin_input_set_label_secondary( desktop_view_pin_input_set_label_secondary(
app->pin_input_view, 7, 45, "Remember Or Write It Down!"); app->pin_input_view, 7, 45, "Remember or write it down");
desktop_view_pin_input_lock_input(app->pin_input_view); desktop_view_pin_input_lock_input(app->pin_input_view);
desktop_view_pin_input_set_pin_position(app->pin_input_view, 64, 24); desktop_view_pin_input_set_pin_position(app->pin_input_view, 64, 24);
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput); view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewIdPinInput);

View File

@@ -24,9 +24,9 @@ static void desktop_settings_view_pin_setup_howto2_draw(Canvas* canvas, void* mo
elements_multiline_text_aligned( elements_multiline_text_aligned(
canvas, canvas,
64, 64,
24, 0,
AlignCenter,
AlignCenter, AlignCenter,
AlignTop,
"Forgotten PIN can only be\n" "Forgotten PIN can only be\n"
"reset with entire device.\n" "reset with entire device.\n"
"Read docs: How to reset PIN."); "Read docs: How to reset PIN.");

View File

@@ -37,3 +37,5 @@ typedef enum {
PowerSettingsAppViewDialog, PowerSettingsAppViewDialog,
PowerSettingsAppViewVariableItemList PowerSettingsAppViewVariableItemList
} PowerSettingsAppView; } PowerSettingsAppView;
typedef enum { RebootTypeDFU, RebootTypeNormal } RebootType;

View File

@@ -1,5 +1,6 @@
ADD_SCENE(power_settings, start, Start) ADD_SCENE(power_settings, start, Start)
ADD_SCENE(power_settings, battery_info, BatteryInfo) ADD_SCENE(power_settings, battery_info, BatteryInfo)
ADD_SCENE(power_settings, reboot, Reboot) ADD_SCENE(power_settings, reboot, Reboot)
ADD_SCENE(power_settings, reboot_confirm, RebootConfirm)
ADD_SCENE(power_settings, power_off, PowerOff) ADD_SCENE(power_settings, power_off, PowerOff)
ADD_SCENE(power_settings, shutdown_idle, ShutdownIdle) ADD_SCENE(power_settings, shutdown_idle, ShutdownIdle)

View File

@@ -1,5 +1,4 @@
#include "../power_settings_app.h" #include "../power_settings_app.h"
#include <momentum/momentum.h>
void power_settings_scene_power_off_dialog_callback(DialogExResult result, void* context) { void power_settings_scene_power_off_dialog_callback(DialogExResult result, void* context) {
furi_assert(context); furi_assert(context);
@@ -11,12 +10,12 @@ void power_settings_scene_power_off_on_enter(void* context) {
PowerSettingsApp* app = context; PowerSettingsApp* app = context;
DialogEx* dialog = app->dialog; DialogEx* dialog = app->dialog;
dialog_ex_set_header(dialog, "Turn OFF Device?", 64, 2, AlignCenter, AlignTop); dialog_ex_set_header(dialog, "Turn Off Device?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text( dialog_ex_set_text(
dialog, " I will be\nwaiting for\n you here", 78, 16, AlignLeft, AlignTop); dialog, " I will be\nwaiting for\n you here...", 78, 14, AlignLeft, AlignTop);
dialog_ex_set_icon(dialog, 21, 13, &I_Cry_dolph_55x52); dialog_ex_set_icon(dialog, 14, 10, &I_dolph_cry_49x54);
dialog_ex_set_left_button_text(dialog, "Battery"); dialog_ex_set_left_button_text(dialog, "Battery");
dialog_ex_set_right_button_text(dialog, "OFF"); dialog_ex_set_right_button_text(dialog, "Power Off");
dialog_ex_set_result_callback(dialog, power_settings_scene_power_off_dialog_callback); dialog_ex_set_result_callback(dialog, power_settings_scene_power_off_dialog_callback);
dialog_ex_set_context(dialog, app); dialog_ex_set_context(dialog, app);

View File

@@ -24,7 +24,7 @@ void power_settings_scene_reboot_on_enter(void* context) {
app); app);
submenu_add_item( submenu_add_item(
submenu, submenu,
"Flipper OS", "Reboot Flipper",
PowerSettingsRebootSubmenuIndexOs, PowerSettingsRebootSubmenuIndexOs,
power_settings_scene_reboot_submenu_callback, power_settings_scene_reboot_submenu_callback,
app); app);
@@ -33,14 +33,18 @@ void power_settings_scene_reboot_on_enter(void* context) {
} }
bool power_settings_scene_reboot_on_event(void* context, SceneManagerEvent event) { bool power_settings_scene_reboot_on_event(void* context, SceneManagerEvent event) {
UNUSED(context); PowerSettingsApp* app = context;
bool consumed = false; bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == PowerSettingsRebootSubmenuIndexDfu) { if(event.event == PowerSettingsRebootSubmenuIndexDfu) {
power_reboot(PowerBootModeDfu); scene_manager_set_scene_state(
app->scene_manager, PowerSettingsAppSceneRebootConfirm, RebootTypeDFU);
scene_manager_next_scene(app->scene_manager, PowerSettingsAppSceneRebootConfirm);
} else if(event.event == PowerSettingsRebootSubmenuIndexOs) { } else if(event.event == PowerSettingsRebootSubmenuIndexOs) {
power_reboot(PowerBootModeNormal); scene_manager_set_scene_state(
app->scene_manager, PowerSettingsAppSceneRebootConfirm, RebootTypeNormal);
scene_manager_next_scene(app->scene_manager, PowerSettingsAppSceneRebootConfirm);
} }
consumed = true; consumed = true;
} }

View File

@@ -0,0 +1,66 @@
#include "../power_settings_app.h"
void power_settings_scene_reboot_confirm_dialog_callback(DialogExResult result, void* context) {
furi_assert(context);
PowerSettingsApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, result);
}
void power_settings_scene_reboot_confirm_on_enter(void* context) {
PowerSettingsApp* app = context;
DialogEx* dialog = app->dialog;
RebootType reboot_type =
scene_manager_get_scene_state(app->scene_manager, PowerSettingsAppSceneRebootConfirm);
if(reboot_type == RebootTypeDFU) {
dialog_ex_set_header(dialog, "Reboot to DFU Mode?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text(
dialog,
"Needed for device maintenance\nor firmware upgrades",
64,
14,
AlignCenter,
AlignTop);
} else if(reboot_type == RebootTypeNormal) {
dialog_ex_set_header(dialog, "Reboot Flipper?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text(
dialog, "May help with some firmware\n issues", 64, 14, AlignCenter, AlignTop);
} else {
furi_crash("Invalid reboot type");
}
dialog_ex_set_left_button_text(dialog, "Cancel");
dialog_ex_set_right_button_text(dialog, "Reboot");
dialog_ex_set_result_callback(dialog, power_settings_scene_reboot_confirm_dialog_callback);
dialog_ex_set_context(dialog, app);
view_dispatcher_switch_to_view(app->view_dispatcher, PowerSettingsAppViewDialog);
}
bool power_settings_scene_reboot_confirm_on_event(void* context, SceneManagerEvent event) {
PowerSettingsApp* app = context;
bool consumed = false;
RebootType reboot_type =
scene_manager_get_scene_state(app->scene_manager, PowerSettingsAppSceneRebootConfirm);
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == DialogExResultLeft) {
scene_manager_previous_scene(app->scene_manager);
} else if(event.event == DialogExResultRight) {
if(reboot_type == RebootTypeDFU) {
power_reboot(PowerBootModeDfu);
} else {
power_reboot(PowerBootModeNormal);
}
}
consumed = true;
}
return consumed;
}
void power_settings_scene_reboot_confirm_on_exit(void* context) {
PowerSettingsApp* app = context;
dialog_ex_reset(app->dialog);
}

View File

@@ -1,5 +1,7 @@
#include "../storage_settings.h" #include "../storage_settings.h"
#include <furi_hal.h> #include <furi_hal.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#define BENCH_DATA_SIZE 4096 #define BENCH_DATA_SIZE 4096
#define BENCH_COUNT 6 #define BENCH_COUNT 6
@@ -86,7 +88,8 @@ static void storage_settings_scene_benchmark(StorageSettings* app) {
uint32_t bench_w_speed[BENCH_COUNT] = {0, 0, 0, 0, 0, 0}; uint32_t bench_w_speed[BENCH_COUNT] = {0, 0, 0, 0, 0, 0};
uint32_t bench_r_speed[BENCH_COUNT] = {0, 0, 0, 0, 0, 0}; uint32_t bench_r_speed[BENCH_COUNT] = {0, 0, 0, 0, 0, 0};
dialog_ex_set_header(dialog_ex, "Benchmarking...", 64, 32, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, "Benchmarking...", 74, 32, AlignCenter, AlignCenter);
dialog_ex_set_icon(dialog_ex, 12, 20, &I_LoadingHourglass_24x24);
for(size_t i = 0; i < BENCH_COUNT; i++) { for(size_t i = 0; i < BENCH_COUNT; i++) {
if(!storage_settings_scene_bench_write( if(!storage_settings_scene_bench_write(
app->fs_api, bench_size[i], bench_data, &bench_w_speed[i])) app->fs_api, bench_size[i], bench_data, &bench_w_speed[i]))
@@ -95,6 +98,7 @@ static void storage_settings_scene_benchmark(StorageSettings* app) {
if(i > 0) furi_string_cat_printf(app->text_string, "\n"); if(i > 0) furi_string_cat_printf(app->text_string, "\n");
furi_string_cat_printf(app->text_string, "%ub : W %luK ", bench_size[i], bench_w_speed[i]); furi_string_cat_printf(app->text_string, "%ub : W %luK ", bench_size[i], bench_w_speed[i]);
dialog_ex_set_header(dialog_ex, NULL, 0, 0, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, NULL, 0, 0, AlignCenter, AlignCenter);
dialog_ex_set_icon(dialog_ex, 0, 0, NULL);
dialog_ex_set_text( dialog_ex_set_text(
dialog_ex, furi_string_get_cstr(app->text_string), 0, 32, AlignLeft, AlignCenter); dialog_ex, furi_string_get_cstr(app->text_string), 0, 32, AlignLeft, AlignCenter);
@@ -110,6 +114,12 @@ static void storage_settings_scene_benchmark(StorageSettings* app) {
dialog_ex, furi_string_get_cstr(app->text_string), 0, 32, AlignLeft, AlignCenter); dialog_ex, furi_string_get_cstr(app->text_string), 0, 32, AlignLeft, AlignCenter);
} }
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
notification_message(notification, &sequence_single_vibro);
notification_message(notification, &sequence_set_green_255);
notification_message(notification, &sequence_success);
furi_record_close(RECORD_NOTIFICATION);
free(bench_data); free(bench_data);
} }
@@ -146,11 +156,17 @@ bool storage_settings_scene_benchmark_on_event(void* context, SceneManagerEvent
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) { switch(event.event) {
case DialogExResultCenter: case DialogExResultCenter:
consumed = scene_manager_previous_scene(app->scene_manager); consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
break; break;
} }
} else if(event.type == SceneManagerEventTypeBack && sd_status != FSE_OK) { } else if(event.type == SceneManagerEventTypeBack) {
consumed = true; if(sd_status == FSE_OK) {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
} else {
consumed = true;
}
} }
return consumed; return consumed;
@@ -160,6 +176,10 @@ void storage_settings_scene_benchmark_on_exit(void* context) {
StorageSettings* app = context; StorageSettings* app = context;
DialogEx* dialog_ex = app->dialog_ex; DialogEx* dialog_ex = app->dialog_ex;
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
notification_message(notification, &sequence_reset_green);
furi_record_close(RECORD_NOTIFICATION);
dialog_ex_reset(dialog_ex); dialog_ex_reset(dialog_ex);
furi_string_reset(app->text_string); furi_string_reset(app->text_string);

View File

@@ -0,0 +1,70 @@
#include "../storage_settings.h"
static void
storage_settings_scene_benchmark_confirm_dialog_callback(DialogExResult result, void* context) {
StorageSettings* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, result);
}
void storage_settings_scene_benchmark_confirm_on_enter(void* context) {
StorageSettings* app = context;
DialogEx* dialog_ex = app->dialog_ex;
FS_Error sd_status = storage_sd_status(app->fs_api);
if(sd_status == FSE_NOT_READY) {
dialog_ex_set_icon(dialog_ex, 83, 22, &I_WarningDolphinFlip_45x42);
dialog_ex_set_header(dialog_ex, "SD Card Not Mounted", 64, 3, AlignCenter, AlignTop);
dialog_ex_set_text(
dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop);
dialog_ex_set_center_button_text(dialog_ex, "Ok");
} else {
dialog_ex_set_header(dialog_ex, "Benchmark SD Card?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text(
dialog_ex,
"SD will be tested in SPI\nmode. Learn more:\nr.flipper.net/sd_test",
0,
12,
AlignLeft,
AlignTop);
dialog_ex_set_icon(dialog_ex, 103, 12, &I_qr_benchmark_25x25);
dialog_ex_set_left_button_text(dialog_ex, "Cancel");
dialog_ex_set_right_button_text(dialog_ex, "Benchmark");
}
dialog_ex_set_context(dialog_ex, app);
dialog_ex_set_result_callback(
dialog_ex, storage_settings_scene_benchmark_confirm_dialog_callback);
view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx);
}
bool storage_settings_scene_benchmark_confirm_on_event(void* context, SceneManagerEvent event) {
StorageSettings* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case DialogExResultLeft:
case DialogExResultCenter:
consumed = scene_manager_previous_scene(app->scene_manager);
break;
case DialogExResultRight:
scene_manager_next_scene(app->scene_manager, StorageSettingsBenchmark);
consumed = true;
break;
}
} else if(event.type == SceneManagerEventTypeBack) {
consumed = true;
}
return consumed;
}
void storage_settings_scene_benchmark_confirm_on_exit(void* context) {
StorageSettings* app = context;
DialogEx* dialog_ex = app->dialog_ex;
dialog_ex_reset(dialog_ex);
}

View File

@@ -5,6 +5,7 @@ ADD_SCENE(storage_settings, format_confirm, FormatConfirm)
ADD_SCENE(storage_settings, formatting, Formatting) ADD_SCENE(storage_settings, formatting, Formatting)
ADD_SCENE(storage_settings, sd_info, SDInfo) ADD_SCENE(storage_settings, sd_info, SDInfo)
ADD_SCENE(storage_settings, internal_info, InternalInfo) ADD_SCENE(storage_settings, internal_info, InternalInfo)
ADD_SCENE(storage_settings, benchmark_confirm, BenchmarkConfirm)
ADD_SCENE(storage_settings, benchmark, Benchmark) ADD_SCENE(storage_settings, benchmark, Benchmark)
ADD_SCENE(storage_settings, factory_reset, FactoryReset) ADD_SCENE(storage_settings, factory_reset, FactoryReset)
ADD_SCENE(storage_settings, wipe_device, WipeDevice) ADD_SCENE(storage_settings, wipe_device, WipeDevice)

View File

@@ -21,14 +21,14 @@ void storage_settings_scene_factory_reset_on_enter(void* context) {
dialog_ex_set_left_button_text(dialog_ex, "Cancel"); dialog_ex_set_left_button_text(dialog_ex, "Cancel");
dialog_ex_set_right_button_text(dialog_ex, "Erase"); dialog_ex_set_right_button_text(dialog_ex, "Erase");
dialog_ex_set_header(dialog_ex, "Confirm Factory Reset", 64, 10, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, "Confirm Factory Reset?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text( dialog_ex_set_text(
dialog_ex, dialog_ex,
"Internal storage will be erased\r\nData and settings will be lost!", "Internal storage will be erased\ndata and settings will be lost!",
64, 64,
32, 14,
AlignCenter, AlignCenter,
AlignCenter); AlignTop);
view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx); view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx);
} }

View File

@@ -20,8 +20,8 @@ void storage_settings_scene_format_confirm_on_enter(void* context) {
dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop); dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop);
dialog_ex_set_center_button_text(dialog_ex, "Ok"); dialog_ex_set_center_button_text(dialog_ex, "Ok");
} else { } else {
dialog_ex_set_header(dialog_ex, "Format SD Card?", 64, 10, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, "Format SD Card?", 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text(dialog_ex, "All data will be lost!", 64, 32, AlignCenter, AlignCenter); dialog_ex_set_text(dialog_ex, "All data will be lost!", 64, 12, AlignCenter, AlignTop);
dialog_ex_set_left_button_text(dialog_ex, "Cancel"); dialog_ex_set_left_button_text(dialog_ex, "Cancel");
dialog_ex_set_right_button_text(dialog_ex, "Format"); dialog_ex_set_right_button_text(dialog_ex, "Format");
} }

View File

@@ -1,4 +1,6 @@
#include "../storage_settings.h" #include "../storage_settings.h"
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <power/power_service/power.h> #include <power/power_service/power.h>
static const NotificationMessage message_green_165 = { static const NotificationMessage message_green_165 = {
@@ -32,7 +34,8 @@ void storage_settings_scene_formatting_on_enter(void* context) {
FS_Error error; FS_Error error;
DialogEx* dialog_ex = app->dialog_ex; DialogEx* dialog_ex = app->dialog_ex;
dialog_ex_set_header(dialog_ex, "Formatting...", 64, 32, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, "Formatting...", 70, 32, AlignCenter, AlignCenter);
dialog_ex_set_icon(dialog_ex, 15, 20, &I_LoadingHourglass_24x24);
view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx); view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx);
notification_message_block(app->notification, &sequence_set_formatting_leds); notification_message_block(app->notification, &sequence_set_formatting_leds);
@@ -45,6 +48,7 @@ void storage_settings_scene_formatting_on_enter(void* context) {
if(error != FSE_OK) { if(error != FSE_OK) {
dialog_ex_set_header(dialog_ex, "Cannot Format SD Card", 64, 10, AlignCenter, AlignCenter); dialog_ex_set_header(dialog_ex, "Cannot Format SD Card", 64, 10, AlignCenter, AlignCenter);
dialog_ex_set_icon(dialog_ex, 0, 0, NULL);
dialog_ex_set_text( dialog_ex_set_text(
dialog_ex, storage_error_get_desc(error), 64, 32, AlignCenter, AlignCenter); dialog_ex, storage_error_get_desc(error), 64, 32, AlignCenter, AlignCenter);
} else { } else {
@@ -53,6 +57,11 @@ void storage_settings_scene_formatting_on_enter(void* context) {
} else { } else {
dialog_ex_set_icon(dialog_ex, 83, 22, &I_WarningDolphinFlip_45x42); dialog_ex_set_icon(dialog_ex, 83, 22, &I_WarningDolphinFlip_45x42);
dialog_ex_set_header(dialog_ex, "Format\ncomplete!", 14, 15, AlignLeft, AlignTop); dialog_ex_set_header(dialog_ex, "Format\ncomplete!", 14, 15, AlignLeft, AlignTop);
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
notification_message(notification, &sequence_single_vibro);
notification_message(notification, &sequence_set_green_255);
notification_message(notification, &sequence_success);
furi_record_close(RECORD_NOTIFICATION);
} }
} }
dialog_ex_set_center_button_text(dialog_ex, "OK"); dialog_ex_set_center_button_text(dialog_ex, "OK");
@@ -80,5 +89,9 @@ void storage_settings_scene_formatting_on_exit(void* context) {
StorageSettings* app = context; StorageSettings* app = context;
DialogEx* dialog_ex = app->dialog_ex; DialogEx* dialog_ex = app->dialog_ex;
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
notification_message(notification, &sequence_reset_green);
furi_record_close(RECORD_NOTIFICATION);
dialog_ex_reset(dialog_ex); dialog_ex_reset(dialog_ex);
} }

View File

@@ -27,7 +27,7 @@ void storage_settings_scene_internal_info_on_enter(void* context) {
} else { } else {
furi_string_printf( furi_string_printf(
app->text_string, app->text_string,
"Label: %s\nType: LittleFS\n%lu KiB total\n%lu KiB free", "Name: %s\nType: LittleFS\nTotal: %lu KiB\nFree: %lu KiB",
furi_hal_version_get_name_ptr() ? furi_hal_version_get_name_ptr() : "Unknown", furi_hal_version_get_name_ptr() ? furi_hal_version_get_name_ptr() : "Unknown",
(uint32_t)(total_space / 1024), (uint32_t)(total_space / 1024),
(uint32_t)(free_space / 1024)); (uint32_t)(free_space / 1024));

View File

@@ -25,30 +25,33 @@ void storage_settings_scene_sd_info_on_enter(void* context) {
dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop); dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop);
dialog_ex_set_center_button_text(dialog_ex, "Ok"); dialog_ex_set_center_button_text(dialog_ex, "Ok");
} else { } else {
double total_v = (double)sd_info.kb_total;
double free_v = (double)sd_info.kb_free;
char* units[] = {"KiB", "MiB", "GiB", "TiB"};
uint8_t total_i, free_i;
for(total_i = 0; total_i < COUNT_OF(units); total_i++) {
if(total_v < 1024) break;
total_v /= 1024;
}
for(free_i = 0; free_i < COUNT_OF(units); free_i++) {
if(free_v < 1024) break;
free_v /= 1024;
}
furi_string_printf( furi_string_printf(
app->text_string, app->text_string,
"Label: %s\nType: %s\n%.2f %s total\n%.2f %s free %.2f%% free\n" "Label: %s\nType: %s\n",
"%02X%s %s v%i.%i\nSN:%04lX %02i/%i",
sd_info.label, sd_info.label,
sd_api_get_fs_type_text(sd_info.fs_type), sd_api_get_fs_type_text(sd_info.fs_type));
total_v,
units[total_i], if(sd_info.kb_total < 1024) {
free_v, furi_string_cat_printf(app->text_string, "Total: %lu KiB\n", sd_info.kb_total);
units[free_i], } else if(sd_info.kb_total < 1024 * 1024) {
(double)(((int)sd_info.kb_free * 100.0) / (int)sd_info.kb_total), furi_string_cat_printf(app->text_string, "Total: %lu MiB\n", sd_info.kb_total / 1024);
} else {
furi_string_cat_printf(
app->text_string, "Total: %lu GiB\n", sd_info.kb_total / (1024 * 1024));
}
if(sd_info.kb_free < 1024) {
furi_string_cat_printf(app->text_string, "Free: %lu KiB\n", sd_info.kb_free);
} else if(sd_info.kb_free < 1024 * 1024) {
furi_string_cat_printf(app->text_string, "Free: %lu MiB\n", sd_info.kb_free / 1024);
} else {
furi_string_cat_printf(
app->text_string, "Free: %lu GiB\n", sd_info.kb_free / (1024 * 1024));
}
furi_string_cat_printf(
app->text_string,
"%02X%s %s v%i.%i\nSN:%04lX %02i/%i",
sd_info.manufacturer_id, sd_info.manufacturer_id,
sd_info.oem_id, sd_info.oem_id,
sd_info.product_name, sd_info.product_name,
@@ -57,6 +60,7 @@ void storage_settings_scene_sd_info_on_enter(void* context) {
sd_info.product_serial_number, sd_info.product_serial_number,
sd_info.manufacturing_month, sd_info.manufacturing_month,
sd_info.manufacturing_year); sd_info.manufacturing_year);
dialog_ex_set_text( dialog_ex_set_text(
dialog_ex, furi_string_get_cstr(app->text_string), 4, 1, AlignLeft, AlignTop); dialog_ex, furi_string_get_cstr(app->text_string), 4, 1, AlignLeft, AlignTop);
} }

View File

@@ -116,7 +116,7 @@ bool storage_settings_scene_start_on_event(void* context, SceneManagerEvent even
case StorageSettingsStartSubmenuIndexBenchy: case StorageSettingsStartSubmenuIndexBenchy:
scene_manager_set_scene_state( scene_manager_set_scene_state(
app->scene_manager, StorageSettingsStart, StorageSettingsStartSubmenuIndexBenchy); app->scene_manager, StorageSettingsStart, StorageSettingsStartSubmenuIndexBenchy);
scene_manager_next_scene(app->scene_manager, StorageSettingsBenchmark); scene_manager_next_scene(app->scene_manager, StorageSettingsBenchmarkConfirm);
consumed = true; consumed = true;
break; break;
case StorageSettingsStartSubmenuIndexFactoryReset: case StorageSettingsStartSubmenuIndexFactoryReset:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

View File

@@ -75,7 +75,7 @@ MfDesfireError mf_desfire_send_chunks(
const size_t rx_capacity_remaining = const size_t rx_capacity_remaining =
bit_buffer_get_capacity_bytes(rx_buffer) - bit_buffer_get_size_bytes(rx_buffer); bit_buffer_get_capacity_bytes(rx_buffer) - bit_buffer_get_size_bytes(rx_buffer);
if(rx_size - 1 <= rx_capacity_remaining) { if(rx_size <= rx_capacity_remaining + 1) {
bit_buffer_append_right(rx_buffer, instance->rx_buffer, sizeof(uint8_t)); bit_buffer_append_right(rx_buffer, instance->rx_buffer, sizeof(uint8_t));
} else { } else {
FURI_LOG_W(TAG, "RX buffer overflow: ignoring %zu bytes", rx_size - 1); FURI_LOG_W(TAG, "RX buffer overflow: ignoring %zu bytes", rx_size - 1);

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,61.2,, Version,+,61.3,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,, Header,+,applications/services/cli/cli_vcp.h,,
@@ -2552,7 +2552,9 @@ Function,-,strxfrm,size_t,"char*, const char*, size_t"
Function,-,strxfrm_l,size_t,"char*, const char*, size_t, locale_t" Function,-,strxfrm_l,size_t,"char*, const char*, size_t, locale_t"
Function,+,submenu_add_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*" Function,+,submenu_add_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*"
Function,+,submenu_alloc,Submenu*, Function,+,submenu_alloc,Submenu*,
Function,+,submenu_change_item_label,void,"Submenu*, uint32_t, const char*"
Function,+,submenu_free,void,Submenu* Function,+,submenu_free,void,Submenu*
Function,+,submenu_get_selected_item,uint32_t,Submenu*
Function,+,submenu_get_view,View*,Submenu* Function,+,submenu_get_view,View*,Submenu*
Function,+,submenu_reset,void,Submenu* Function,+,submenu_reset,void,Submenu*
Function,+,submenu_set_header,void,"Submenu*, const char*" Function,+,submenu_set_header,void,"Submenu*, const char*"
1 entry status name type params
2 Version + 61.2 61.3
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
2552 Function - strxfrm_l size_t char*, const char*, size_t, locale_t
2553 Function + submenu_add_item void Submenu*, const char*, uint32_t, SubmenuItemCallback, void*
2554 Function + submenu_alloc Submenu*
2555 Function + submenu_change_item_label void Submenu*, uint32_t, const char*
2556 Function + submenu_free void Submenu*
2557 Function + submenu_get_selected_item uint32_t Submenu*
2558 Function + submenu_get_view View* Submenu*
2559 Function + submenu_reset void Submenu*
2560 Function + submenu_set_header void Submenu*, const char*

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,61.2,, Version,+,61.3,,
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,, Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
Header,+,applications/main/archive/helpers/archive_helpers_ext.h,, Header,+,applications/main/archive/helpers/archive_helpers_ext.h,,
Header,+,applications/main/subghz/subghz_fap.h,, Header,+,applications/main/subghz/subghz_fap.h,,
@@ -3520,7 +3520,9 @@ Function,+,subghz_worker_stop,void,SubGhzWorker*
Function,+,submenu_add_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*" Function,+,submenu_add_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*"
Function,+,submenu_add_lockable_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*, _Bool, const char*" Function,+,submenu_add_lockable_item,void,"Submenu*, const char*, uint32_t, SubmenuItemCallback, void*, _Bool, const char*"
Function,+,submenu_alloc,Submenu*, Function,+,submenu_alloc,Submenu*,
Function,+,submenu_change_item_label,void,"Submenu*, uint32_t, const char*"
Function,+,submenu_free,void,Submenu* Function,+,submenu_free,void,Submenu*
Function,+,submenu_get_selected_item,uint32_t,Submenu*
Function,+,submenu_get_view,View*,Submenu* Function,+,submenu_get_view,View*,Submenu*
Function,+,submenu_reset,void,Submenu* Function,+,submenu_reset,void,Submenu*
Function,+,submenu_set_header,void,"Submenu*, const char*" Function,+,submenu_set_header,void,"Submenu*, const char*"
@@ -3792,7 +3794,7 @@ Variable,+,I_CC_Settings_16x16,Icon,
Variable,+,I_Certification1_103x56,Icon, Variable,+,I_Certification1_103x56,Icon,
Variable,+,I_Certification2_46x33,Icon, Variable,+,I_Certification2_46x33,Icon,
Variable,+,I_CertificationChina0_121x41,Icon, Variable,+,I_CertificationChina0_121x41,Icon,
Variable,+,I_CertificationChina1_122x47,Icon, Variable,+,I_CertificationChina1_124x47,Icon,
Variable,+,I_CertificationMexico_98x41,Icon, Variable,+,I_CertificationMexico_98x41,Icon,
Variable,+,I_CertificationTaiwan_33x32,Icon, Variable,+,I_CertificationTaiwan_33x32,Icon,
Variable,+,I_Charging_lightning_9x10,Icon, Variable,+,I_Charging_lightning_9x10,Icon,
@@ -3802,7 +3804,6 @@ Variable,+,I_Clock_18x18,Icon,
Variable,+,I_Connect_me_62x31,Icon, Variable,+,I_Connect_me_62x31,Icon,
Variable,+,I_Connected_62x31,Icon, Variable,+,I_Connected_62x31,Icon,
Variable,+,I_Cos_9x7,Icon, Variable,+,I_Cos_9x7,Icon,
Variable,+,I_Cry_dolph_55x52,Icon,
Variable,+,I_DFU_128x50,Icon, Variable,+,I_DFU_128x50,Icon,
Variable,+,I_DolphinDone_80x58,Icon, Variable,+,I_DolphinDone_80x58,Icon,
Variable,+,I_DolphinMafia_119x62,Icon, Variable,+,I_DolphinMafia_119x62,Icon,
@@ -3839,6 +3840,7 @@ Variable,+,I_KeySaveSelected_22x11,Icon,
Variable,+,I_KeySave_22x11,Icon, Variable,+,I_KeySave_22x11,Icon,
Variable,+,I_Keychain_39x36,Icon, Variable,+,I_Keychain_39x36,Icon,
Variable,+,I_Left_mouse_icon_9x9,Icon, Variable,+,I_Left_mouse_icon_9x9,Icon,
Variable,+,I_LoadingHourglass_24x24,Icon,
Variable,+,I_Lock_7x8,Icon, Variable,+,I_Lock_7x8,Icon,
Variable,+,I_Lockscreen,Icon, Variable,+,I_Lockscreen,Icon,
Variable,+,I_MFKey_qr_25x25,Icon, Variable,+,I_MFKey_qr_25x25,Icon,
@@ -3907,6 +3909,7 @@ Variable,+,I_ch_up_hover_24x21,Icon,
Variable,+,I_check_big_20x17,Icon, Variable,+,I_check_big_20x17,Icon,
Variable,+,I_cool_30x51,Icon, Variable,+,I_cool_30x51,Icon,
Variable,+,I_dir_10px,Icon, Variable,+,I_dir_10px,Icon,
Variable,+,I_dolph_cry_49x54,Icon,
Variable,+,I_dry_19x20,Icon, Variable,+,I_dry_19x20,Icon,
Variable,+,I_dry_hover_19x20,Icon, Variable,+,I_dry_hover_19x20,Icon,
Variable,+,I_dry_text_15x5,Icon, Variable,+,I_dry_text_15x5,Icon,
@@ -3972,6 +3975,7 @@ Variable,+,I_power_text_24x5,Icon,
Variable,+,I_prev_19x20,Icon, Variable,+,I_prev_19x20,Icon,
Variable,+,I_prev_hover_19x20,Icon, Variable,+,I_prev_hover_19x20,Icon,
Variable,+,I_prev_text_19x5,Icon, Variable,+,I_prev_text_19x5,Icon,
Variable,+,I_qr_benchmark_25x25,Icon,
Variable,+,I_rotate_19x20,Icon, Variable,+,I_rotate_19x20,Icon,
Variable,+,I_rotate_hover_19x20,Icon, Variable,+,I_rotate_hover_19x20,Icon,
Variable,+,I_rotate_text_24x5,Icon, Variable,+,I_rotate_text_24x5,Icon,
1 entry status name type params
2 Version + 61.2 61.3
3 Header + applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h
4 Header + applications/main/archive/helpers/archive_helpers_ext.h
5 Header + applications/main/subghz/subghz_fap.h
3520 Function + submenu_add_item void Submenu*, const char*, uint32_t, SubmenuItemCallback, void*
3521 Function + submenu_add_lockable_item void Submenu*, const char*, uint32_t, SubmenuItemCallback, void*, _Bool, const char*
3522 Function + submenu_alloc Submenu*
3523 Function + submenu_change_item_label void Submenu*, uint32_t, const char*
3524 Function + submenu_free void Submenu*
3525 Function + submenu_get_selected_item uint32_t Submenu*
3526 Function + submenu_get_view View* Submenu*
3527 Function + submenu_reset void Submenu*
3528 Function + submenu_set_header void Submenu*, const char*
3794 Variable + I_Certification1_103x56 Icon
3795 Variable + I_Certification2_46x33 Icon
3796 Variable + I_CertificationChina0_121x41 Icon
3797 Variable + I_CertificationChina1_122x47 I_CertificationChina1_124x47 Icon
3798 Variable + I_CertificationMexico_98x41 Icon
3799 Variable + I_CertificationTaiwan_33x32 Icon
3800 Variable + I_Charging_lightning_9x10 Icon
3804 Variable + I_Connect_me_62x31 Icon
3805 Variable + I_Connected_62x31 Icon
3806 Variable + I_Cos_9x7 Icon
Variable + I_Cry_dolph_55x52 Icon
3807 Variable + I_DFU_128x50 Icon
3808 Variable + I_DolphinDone_80x58 Icon
3809 Variable + I_DolphinMafia_119x62 Icon
3840 Variable + I_KeySave_22x11 Icon
3841 Variable + I_Keychain_39x36 Icon
3842 Variable + I_Left_mouse_icon_9x9 Icon
3843 Variable + I_LoadingHourglass_24x24 Icon
3844 Variable + I_Lock_7x8 Icon
3845 Variable + I_Lockscreen Icon
3846 Variable + I_MFKey_qr_25x25 Icon
3909 Variable + I_check_big_20x17 Icon
3910 Variable + I_cool_30x51 Icon
3911 Variable + I_dir_10px Icon
3912 Variable + I_dolph_cry_49x54 Icon
3913 Variable + I_dry_19x20 Icon
3914 Variable + I_dry_hover_19x20 Icon
3915 Variable + I_dry_text_15x5 Icon
3975 Variable + I_prev_19x20 Icon
3976 Variable + I_prev_hover_19x20 Icon
3977 Variable + I_prev_text_19x5 Icon
3978 Variable + I_qr_benchmark_25x25 Icon
3979 Variable + I_rotate_19x20 Icon
3980 Variable + I_rotate_hover_19x20 Icon
3981 Variable + I_rotate_text_24x5 Icon