Skip to content

Commit

Permalink
[FL-2747, FL-2745] Browser worker fix, Device Info screen update flip…
Browse files Browse the repository at this point in the history
…perdevices#1620

Co-authored-by: あく <[email protected]>
  • Loading branch information
nminaylov and skotopes authored Aug 18, 2022
1 parent 2e993b0 commit 2a45206
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
15 changes: 8 additions & 7 deletions applications/desktop/views/desktop_view_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ void desktop_debug_render(Canvas* canvas, void* model) {
const Version* ver;
char buffer[64];

static const char* headers[] = {"FW Version Info:", "Dolphin Info:"};
static const char* headers[] = {"Device Info:", "Dolphin Info:"};

canvas_set_color(canvas, ColorBlack);
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 2, 9 + STATUS_BAR_Y_SHIFT, headers[m->screen]);
canvas_draw_str_aligned(
canvas, 64, 1 + STATUS_BAR_Y_SHIFT, AlignCenter, AlignTop, headers[m->screen]);
canvas_set_font(canvas, FontSecondary);

if(m->screen != DesktopViewStatsMeta) {
Expand All @@ -44,15 +45,15 @@ void desktop_debug_render(Canvas* canvas, void* model) {
furi_hal_version_get_hw_region_name(),
furi_hal_region_get_name(),
my_name ? my_name : "Unknown");
canvas_draw_str(canvas, 5, 19 + STATUS_BAR_Y_SHIFT, buffer);
canvas_draw_str(canvas, 0, 19 + STATUS_BAR_Y_SHIFT, buffer);

ver = furi_hal_version_get_firmware_version();
const BleGlueC2Info* c2_ver = NULL;
#ifdef SRV_BT
c2_ver = ble_glue_get_c2_info();
#endif
if(!ver) {
canvas_draw_str(canvas, 5, 29 + STATUS_BAR_Y_SHIFT, "No info");
canvas_draw_str(canvas, 0, 30 + STATUS_BAR_Y_SHIFT, "No info");
return;
}

Expand All @@ -62,7 +63,7 @@ void desktop_debug_render(Canvas* canvas, void* model) {
"%s [%s]",
version_get_version(ver),
version_get_builddate(ver));
canvas_draw_str(canvas, 5, 28 + STATUS_BAR_Y_SHIFT, buffer);
canvas_draw_str(canvas, 0, 30 + STATUS_BAR_Y_SHIFT, buffer);

snprintf(
buffer,
Expand All @@ -72,11 +73,11 @@ void desktop_debug_render(Canvas* canvas, void* model) {
version_get_githash(ver),
version_get_gitbranchnum(ver),
c2_ver ? c2_ver->StackTypeString : "<none>");
canvas_draw_str(canvas, 5, 39 + STATUS_BAR_Y_SHIFT, buffer);
canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer);

snprintf(
buffer, sizeof(buffer), "[%d] %s", version_get_target(ver), version_get_gitbranch(ver));
canvas_draw_str(canvas, 5, 50 + STATUS_BAR_Y_SHIFT, buffer);
canvas_draw_str(canvas, 0, 50 + STATUS_BAR_Y_SHIFT, buffer);

} else {
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
Expand Down
5 changes: 5 additions & 0 deletions applications/gui/modules/file_browser_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ static bool browser_folder_check_and_switch(string_t path) {
FileInfo file_info;
Storage* storage = furi_record_open(RECORD_STORAGE);
bool is_root = false;

if(string_search_rchar(path, '/') == 0) {
is_root = true;
}

while(1) {
// Check if folder is existing and navigate back if not
if(storage_common_stat(storage, string_get_cstr(path), &file_info) == FSE_OK) {
Expand Down
2 changes: 1 addition & 1 deletion firmware/targets/f7/ble_glue/ble_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void ble_glue_update_c2_fw_info() {
snprintf(
local_info->StackTypeString,
BLE_GLUE_MAX_VERSION_STRING_LEN,
"%d.%d.%d.%s",
"%d.%d.%d:%s",
local_info->VersionMajor,
local_info->VersionMinor,
local_info->VersionSub,
Expand Down

0 comments on commit 2a45206

Please sign in to comment.