[FL-3351] github: re-enabled f18 build (#2743)

* github: re-enabled f18 build
* scripts: storage: better transfer logging
* Fix PVS warnings

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger 2023-06-08 10:16:01 +04:00 committed by GitHub
parent c186d2b0cc
commit 3226254876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 24 deletions

View File

@ -9,7 +9,7 @@ on:
pull_request:
env:
TARGETS: f7
TARGETS: f7 f18
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /runner/_work
@ -96,8 +96,8 @@ jobs:
- name: 'Copy map analyser files'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf map_analyser_files/firmware.elf
cp ${{ github.event_path }} map_analyser_files/event.json
- name: 'Analyse map file'

View File

@ -50,7 +50,7 @@ static void nfc_scene_nfcv_emulate_widget_config(Nfc* nfc, bool data_received) {
widget_add_icon_element(widget, 0, 3, &I_NFC_dolphin_emulation_47x61);
widget_add_string_multiline_element(
widget, 87, 13, AlignCenter, AlignTop, FontPrimary, "Emulating\nNFC V");
if(strcmp(nfc->dev->dev_name, "")) {
if(strcmp(nfc->dev->dev_name, "") != 0) {
furi_string_printf(info_str, "%s", nfc->dev->dev_name);
} else {
for(uint8_t i = 0; i < data->uid_len; i++) {

View File

@ -808,7 +808,7 @@ static bool nfc_device_save_slix2_data(FlipperFormat* file, NfcDevice* dev) {
return saved;
}
bool nfc_device_load_slix2_data(FlipperFormat* file, NfcDevice* dev) {
bool nfc_device_load_slix2_data(FlipperFormat* file, NfcDevice* dev) { // -V524
bool parsed = false;
NfcVSlixData* data = &dev->dev_data.nfcv_data.sub_data.slix;
memset(data, 0, sizeof(NfcVSlixData));

View File

@ -297,10 +297,10 @@ void nfc_worker_nfcv_unlock(NfcWorker* nfc_worker) {
ret = slix_unlock(nfcv_data, 4);
} else {
key = 0x7FFD6E5B;
key_data[0] = key >> 24;
key_data[1] = key >> 16;
key_data[2] = key >> 8;
key_data[3] = key >> 0;
key_data[0] = (key >> 24) & 0xFF;
key_data[1] = (key >> 16) & 0xFF;
key_data[2] = (key >> 8) & 0xFF;
key_data[3] = (key >> 0) & 0xFF;
ret = slix_unlock(nfcv_data, 4);
if(ret != ERR_NONE) {
@ -317,10 +317,10 @@ void nfc_worker_nfcv_unlock(NfcWorker* nfc_worker) {
}
key = 0x0F0F0F0F;
key_data[0] = key >> 24;
key_data[1] = key >> 16;
key_data[2] = key >> 8;
key_data[3] = key >> 0;
key_data[0] = (key >> 24) & 0xFF;
key_data[1] = (key >> 16) & 0xFF;
key_data[2] = (key >> 8) & 0xFF;
key_data[3] = (key >> 0) & 0xFF;
ret = slix_unlock(nfcv_data, 4);
}
}

View File

@ -438,7 +438,7 @@ void nfcv_emu_send(
furi_assert(nfcv);
/* picked default value (0) to match the most common format */
if(!flags) {
if(flags == NfcVSendFlagsNormal) {
flags = NfcVSendFlagsSof | NfcVSendFlagsCrc | NfcVSendFlagsEof |
NfcVSendFlagsOneSubcarrier | NfcVSendFlagsHighRate;
}
@ -1326,7 +1326,7 @@ bool nfcv_emu_loop(
bits_received += 2;
if(periods == 1) {
byte_value |= 0x00 << 6;
byte_value |= 0x00 << 6; // -V684
periods_previous = 6;
} else if(periods == 3) {
byte_value |= 0x01 << 6;

View File

@ -381,7 +381,7 @@ void slix_prepare(NfcVData* nfcv_data) {
ctx->emu_protocol_filter = &slix_protocol_filter;
}
bool slix2_protocol_filter(
bool slix2_protocol_filter( // -V524
FuriHalNfcTxRxContext* tx_rx,
FuriHalNfcDevData* nfc_data,
void* nfcv_data_in) {

View File

@ -257,12 +257,12 @@ class FlipperStorage:
self.read.until(self.CLI_PROMPT)
ftell = file.tell()
percent = str(math.ceil(ftell / filesize * 100))
total_chunks = str(math.ceil(filesize / buffer_size))
current_chunk = str(math.ceil(ftell / buffer_size))
percent = math.ceil(ftell / filesize * 100)
total_chunks = math.ceil(filesize / buffer_size)
current_chunk = math.ceil(ftell / buffer_size)
approx_speed = ftell / (time.time() - start_time + 0.0001)
sys.stdout.write(
f"\r{percent}%, chunk {current_chunk} of {total_chunks} @ {approx_speed/1024:.2f} kb/s"
f"\r<{percent:3d}%, chunk {current_chunk:2d} of {total_chunks:2d} @ {approx_speed/1024:.2f} kb/s"
)
sys.stdout.flush()
print()
@ -270,6 +270,7 @@ class FlipperStorage:
def read_file(self, filename: str):
"""Receive file from Flipper, and get filedata (bytes)"""
buffer_size = self.chunk_size
start_time = time.time()
self.send_and_wait_eol(
'storage read_chunks "' + filename + '" ' + str(buffer_size) + "\r"
)
@ -290,10 +291,13 @@ class FlipperStorage:
filedata.extend(self.port.read(chunk_size))
read_size = read_size + chunk_size
percent = str(math.ceil(read_size / size * 100))
total_chunks = str(math.ceil(size / buffer_size))
current_chunk = str(math.ceil(read_size / buffer_size))
sys.stdout.write(f"\r{percent}%, chunk {current_chunk} of {total_chunks}")
percent = math.ceil(read_size / size * 100)
total_chunks = math.ceil(size / buffer_size)
current_chunk = math.ceil(read_size / buffer_size)
approx_speed = read_size / (time.time() - start_time + 0.0001)
sys.stdout.write(
f"\r>{percent:3d}%, chunk {current_chunk:2d} of {total_chunks:2d} @ {approx_speed/1024:.2f} kb/s"
)
sys.stdout.flush()
print()
self.read.until(self.CLI_PROMPT)