Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
TARGETS: f7
TARGETS: f7 f18
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /runner/_work

Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/scenes/nfc_scene_nfcv_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc/nfc_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
16 changes: 8 additions & 8 deletions lib/nfc/nfc_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/nfc/protocols/nfcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc/protocols/slix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
20 changes: 12 additions & 8 deletions scripts/flipper/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,20 @@ def send_file(self, filename_from: str, filename_to: str):
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()

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"
)
Expand All @@ -290,10 +291,13 @@ def read_file(self, filename: str):
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)
Expand Down