[FL-3300] API version in UI (#2649)
* desktop, about: replaced commit# with API version * scripts: storage: added approx speed for file uploads * scripts: selfupdate: use folder name by default * vscode: fixed broken get_blackmagic shell integration on *nix Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
f7dd77795a
commit
538f96f0ac
7
.vscode/example/launch.json
vendored
7
.vscode/example/launch.json
vendored
@ -11,11 +11,10 @@
|
|||||||
"args": {
|
"args": {
|
||||||
"useSingleResult": true,
|
"useSingleResult": true,
|
||||||
"env": {
|
"env": {
|
||||||
"PATH": "${workspaceFolder};${env:PATH}",
|
"PATH": "${workspaceFolder}${command:extension.commandvariable.envListSep}${env:PATH}"
|
||||||
"FBT_QUIET": 1
|
|
||||||
},
|
},
|
||||||
"command": "fbt get_blackmagic",
|
"command": "fbt -s get_blackmagic",
|
||||||
"description": "Get Blackmagic device",
|
"description": "Get Blackmagic device"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@ -8,7 +8,8 @@
|
|||||||
"amiralizadeh9480.cpp-helper",
|
"amiralizadeh9480.cpp-helper",
|
||||||
"marus25.cortex-debug",
|
"marus25.cortex-debug",
|
||||||
"zxh404.vscode-proto3",
|
"zxh404.vscode-proto3",
|
||||||
"augustocdias.tasks-shell-input"
|
"augustocdias.tasks-shell-input",
|
||||||
|
"rioj7.command-variable"
|
||||||
],
|
],
|
||||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||||
"unwantedRecommendations": [
|
"unwantedRecommendations": [
|
||||||
|
|||||||
@ -65,13 +65,16 @@ void desktop_debug_render(Canvas* canvas, void* model) {
|
|||||||
version_get_builddate(ver));
|
version_get_builddate(ver));
|
||||||
canvas_draw_str(canvas, 0, 30 + STATUS_BAR_Y_SHIFT, buffer);
|
canvas_draw_str(canvas, 0, 30 + STATUS_BAR_Y_SHIFT, buffer);
|
||||||
|
|
||||||
|
uint16_t api_major, api_minor;
|
||||||
|
furi_hal_info_get_api_version(&api_major, &api_minor);
|
||||||
snprintf(
|
snprintf(
|
||||||
buffer,
|
buffer,
|
||||||
sizeof(buffer),
|
sizeof(buffer),
|
||||||
"%s%s [%s] %s",
|
"%s%s [%d.%d] %s",
|
||||||
version_get_dirty_flag(ver) ? "[!] " : "",
|
version_get_dirty_flag(ver) ? "[!] " : "",
|
||||||
version_get_githash(ver),
|
version_get_githash(ver),
|
||||||
version_get_gitbranchnum(ver),
|
api_major,
|
||||||
|
api_minor,
|
||||||
c2_ver ? c2_ver->StackTypeString : "<none>");
|
c2_ver ? c2_ver->StackTypeString : "<none>");
|
||||||
canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer);
|
canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer);
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include <furi_hal_version.h>
|
#include <furi_hal_version.h>
|
||||||
#include <furi_hal_region.h>
|
#include <furi_hal_region.h>
|
||||||
#include <furi_hal_bt.h>
|
#include <furi_hal_bt.h>
|
||||||
|
#include <furi_hal_info.h>
|
||||||
|
|
||||||
typedef DialogMessageButton (*AboutDialogScreen)(DialogsApp* dialogs, DialogMessage* message);
|
typedef DialogMessageButton (*AboutDialogScreen)(DialogsApp* dialogs, DialogMessage* message);
|
||||||
|
|
||||||
@ -134,14 +135,17 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
|
|||||||
if(!ver) { //-V1051
|
if(!ver) { //-V1051
|
||||||
furi_string_cat_printf(buffer, "No info\n");
|
furi_string_cat_printf(buffer, "No info\n");
|
||||||
} else {
|
} else {
|
||||||
|
uint16_t api_major, api_minor;
|
||||||
|
furi_hal_info_get_api_version(&api_major, &api_minor);
|
||||||
furi_string_cat_printf(
|
furi_string_cat_printf(
|
||||||
buffer,
|
buffer,
|
||||||
"%s [%s]\n%s%s [%s] %s\n[%d] %s",
|
"%s [%s]\n%s%s [%d.%d] %s\n[%d] %s",
|
||||||
version_get_version(ver),
|
version_get_version(ver),
|
||||||
version_get_builddate(ver),
|
version_get_builddate(ver),
|
||||||
version_get_dirty_flag(ver) ? "[!] " : "",
|
version_get_dirty_flag(ver) ? "[!] " : "",
|
||||||
version_get_githash(ver),
|
version_get_githash(ver),
|
||||||
version_get_gitbranchnum(ver),
|
api_major,
|
||||||
|
api_minor,
|
||||||
c2_ver ? c2_ver->StackTypeString : "<none>",
|
c2_ver ? c2_ver->StackTypeString : "<none>",
|
||||||
version_get_target(ver),
|
version_get_target(ver),
|
||||||
version_get_gitbranch(ver));
|
version_get_gitbranch(ver));
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
import serial
|
|
||||||
import time
|
|
||||||
import hashlib
|
|
||||||
import math
|
|
||||||
import logging
|
|
||||||
import posixpath
|
|
||||||
import enum
|
import enum
|
||||||
|
import hashlib
|
||||||
|
import logging
|
||||||
|
import math
|
||||||
|
import os
|
||||||
|
import posixpath
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
import serial
|
||||||
|
|
||||||
|
|
||||||
def timing(func):
|
def timing(func):
|
||||||
@ -236,6 +237,7 @@ class FlipperStorage:
|
|||||||
filesize = os.fstat(file.fileno()).st_size
|
filesize = os.fstat(file.fileno()).st_size
|
||||||
|
|
||||||
buffer_size = self.chunk_size
|
buffer_size = self.chunk_size
|
||||||
|
start_time = time.time()
|
||||||
while True:
|
while True:
|
||||||
filedata = file.read(buffer_size)
|
filedata = file.read(buffer_size)
|
||||||
size = len(filedata)
|
size = len(filedata)
|
||||||
@ -254,11 +256,13 @@ class FlipperStorage:
|
|||||||
self.port.write(filedata)
|
self.port.write(filedata)
|
||||||
self.read.until(self.CLI_PROMPT)
|
self.read.until(self.CLI_PROMPT)
|
||||||
|
|
||||||
percent = str(math.ceil(file.tell() / filesize * 100))
|
ftell = file.tell()
|
||||||
|
percent = str(math.ceil(ftell / filesize * 100))
|
||||||
total_chunks = str(math.ceil(filesize / buffer_size))
|
total_chunks = str(math.ceil(filesize / buffer_size))
|
||||||
current_chunk = str(math.ceil(file.tell() / buffer_size))
|
current_chunk = str(math.ceil(ftell / buffer_size))
|
||||||
|
approx_speed = ftell / (time.time() - start_time + 0.0001)
|
||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
f"\r{percent}%, chunk {current_chunk} of {total_chunks}"
|
f"\r{percent}%, chunk {current_chunk} of {total_chunks} @ {approx_speed/1024:.2f} kb/s"
|
||||||
)
|
)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
print()
|
print()
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class Main(App):
|
|||||||
|
|
||||||
self.parser.add_argument("manifest_path", help="Manifest path")
|
self.parser.add_argument("manifest_path", help="Manifest path")
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--pkg_dir_name", help="Update dir name", default="pcbundle", required=False
|
"--pkg_dir_name", help="Update dir name", default=None, required=False
|
||||||
)
|
)
|
||||||
self.parser.set_defaults(func=self.install)
|
self.parser.set_defaults(func=self.install)
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,8 @@
|
|||||||
"amiralizadeh9480.cpp-helper",
|
"amiralizadeh9480.cpp-helper",
|
||||||
"marus25.cortex-debug",
|
"marus25.cortex-debug",
|
||||||
"zxh404.vscode-proto3",
|
"zxh404.vscode-proto3",
|
||||||
"augustocdias.tasks-shell-input"
|
"augustocdias.tasks-shell-input",
|
||||||
|
"rioj7.command-variable"
|
||||||
],
|
],
|
||||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||||
"unwantedRecommendations": [
|
"unwantedRecommendations": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user