Skip to content

Commit

Permalink
merged upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
v1nc committed Sep 1, 2022
2 parents 634b739 + 9ff35c9 commit 0545d5e
Show file tree
Hide file tree
Showing 492 changed files with 20,122 additions and 7,818 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ steps:
- cp assets/resources/nfc/assets/mf_classic_dict.nfc sd-card/nfc/assets/mf_classic_dict.nfc
- cp assets/resources/infrared/assets/tv.ir sd-card/infrared/assets/tv.ir
- cp assets/resources/infrared/assets/ac.ir sd-card/infrared/assets/ac.ir
- cp assets/resources/infrared/assets/fans.ir sd-card/infrared/assets/fans.ir
- cp assets/resources/infrared/assets/projectors.ir sd-card/infrared/assets/projectors.ir
- cp assets/resources/infrared/assets/audio.ir sd-card/infrared/assets/audio.ir
- cp assets/resources/unirf/unirf_map_example.txt sd-card/unirf/unirf_map_example.txt
- cp assets/resources/Manifest sd-card/Manifest
Expand Down Expand Up @@ -114,9 +116,7 @@ steps:
[-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
document:
- artifacts-default/flipper-z-f7-full-${DRONE_TAG}.dfu
- artifacts-default/flipper-z-f7-update-${DRONE_TAG}.zip
- artifacts-default/sd-card-${DRONE_TAG}.zip
- artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz

- name: "Send discord notification"
image: appleboy/drone-discord
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ build/

# openocd output file
openocd.log

# PVS Studio temporary files
.PVS-Studio/
PVS-Studio.log
22 changes: 22 additions & 0 deletions .pvsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MLib macros we can't do much about.
//-V:M_EACH:1048,1044
//-V:ARRAY_DEF:760,747,568,776,729,712,654
//-V:LIST_DEF:760,747,568,712,729,654,776
//-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685
//-V:ALGO_DEF:1048,747,1044

# Non-severe malloc/null pointer deref warnings
//-V::522:2,3

# Warning about headers with copyleft license
//-V::1042

# Potentially null argument warnings
//-V:memset:575
//-V:memcpy:575
//-V:strcpy:575
//-V:strchr:575

# For loop warning on M_FOREACH
//-V:for:1044
1 change: 1 addition & 0 deletions .pvsoptions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--rules-config .pvsconfig -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e */arm-none-eabi/*
27 changes: 17 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
### New changes
* Wifi Marauder app update (by @0xchocolate)
* Updated Universal remote assets (by @Amec0e)
* Fixed music player
* Fixed typos in subghz encoders
* OFW: New NFC info screens
* OFW: U2F fixes
* NRF24 sniffer - tweak sniff parameters for more speed and reliability (by @mothball187) (PR #51)
* Fixed text in LF RFID -> Extra Actions
* Updated universal remote assets (by @Amec0e)
* OFW PR: SubGHz decode raw gui (by @qistoph) (PR 1667) / xMasterX: Replaced custom image with default one & Fixed Led don't stop blink after pressing Send from decoder scene
* WAV Player plugin excluded from releases to save space, you can enable it in `applications\meta` for your builds
* OFW PR: SubGhz: add protocol Intertechno_V3 - OFW PR 1622
* OFW PR: SubGhz: add protocol Prastel - OFW PR 1674
* OFW PR: Fix displaying LFRFID protocol names - OFW PR 1682 / xMasterX: Fixed display for N/A manufacturer
* OFW: LF RFID - PAC/Stanley, Paradox, Jablotron, Viking, Pyramid protocols support
* OFW: Picopass write (PR 1658)
* OFW: SubGhz: fix CLI "subghz tx"
* OFW: IR: Fix crash after cancelling Learn New Remote
* OFW: SubGhz: output debug data to external pin
* OFW: Speedup SD card & enlarge your RAM
* OFW: Other small changes

**Note: Prefer installing using web updater or by self update package, all needed assets will be installed**
**Note: To avoid issues prefer installing using web updater or by self update package, all needed assets will be installed**

**Build naming has been changed - all same as before but `cg - codegrabber` changed to `un - unleashed`**

Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip`
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or `.tgz` for iOS mobile app

DFU for update using qFlipper - `flipper-z-f7-full-(version).dfu`

Expand Down
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The great user [dummy-decoy](https:/dummy-decoy) implemented loading
* DOGE: `D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`
* LTC: `ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`

_logo generated with DALLE-2_
_logo generated with DALLE-2_
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Main Fipper Build System entry point
# Main Flipper Build System entry point
#
# This file is evaluated by scons (the build system) every time fbt is invoked.
# Scons constructs all referenced environments & their targets' dependency
Expand All @@ -15,7 +15,7 @@ DefaultEnvironment(tools=[])
# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)


# This environment is created only for loading options & validating file/dir existance
# This environment is created only for loading options & validating file/dir existence
fbt_variables = SConscript("site_scons/commandline.scons")
cmd_environment = Environment(tools=[], variables=fbt_variables)
Help(fbt_variables.GenerateHelpText(cmd_environment))
Expand Down
18 changes: 4 additions & 14 deletions applications/archive/helpers/archive_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,13 @@ bool archive_app_is_available(void* context, const char* path) {

if(app == ArchiveAppTypeU2f) {
bool file_exists = false;
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);

file_exists =
storage_file_open(file, ANY_PATH("u2f/key.u2f"), FSAM_READ, FSOM_OPEN_EXISTING);
if(file_exists) {
storage_file_close(file);
file_exists =
storage_file_open(file, ANY_PATH("u2f/cnt.u2f"), FSAM_READ, FSOM_OPEN_EXISTING);
if(file_exists) {
storage_file_close(file);
}
Storage* storage = furi_record_open(RECORD_STORAGE);

if(storage_file_exists(storage, ANY_PATH("u2f/key.u2f"))) {
file_exists = storage_file_exists(storage, ANY_PATH("u2f/cnt.u2f"));
}

storage_file_free(file);
furi_record_close(RECORD_STORAGE);

return file_exists;
} else {
return false;
Expand Down
28 changes: 19 additions & 9 deletions applications/archive/helpers/archive_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,24 @@ static void archive_long_load_cb(void* context) {
});
}

void archive_file_browser_set_callbacks(ArchiveBrowserView* browser) {
static void archive_file_browser_set_path(
ArchiveBrowserView* browser,
string_t path,
const char* filter_ext,
bool skip_assets) {
furi_assert(browser);

file_browser_worker_set_callback_context(browser->worker, browser);
file_browser_worker_set_folder_callback(browser->worker, archive_folder_open_cb);
file_browser_worker_set_list_callback(browser->worker, archive_list_load_cb);
file_browser_worker_set_item_callback(browser->worker, archive_list_item_cb);
file_browser_worker_set_long_load_callback(browser->worker, archive_long_load_cb);
if(!browser->worker_running) {
browser->worker = file_browser_worker_alloc(path, filter_ext, skip_assets);
file_browser_worker_set_callback_context(browser->worker, browser);
file_browser_worker_set_folder_callback(browser->worker, archive_folder_open_cb);
file_browser_worker_set_list_callback(browser->worker, archive_list_load_cb);
file_browser_worker_set_item_callback(browser->worker, archive_list_item_cb);
file_browser_worker_set_long_load_callback(browser->worker, archive_long_load_cb);
browser->worker_running = true;
} else {
furi_assert(browser->worker);
file_browser_worker_set_config(browser->worker, path, filter_ext, skip_assets);
}
}

bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx) {
Expand Down Expand Up @@ -438,8 +448,8 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
tab = archive_get_tab(browser);
if(archive_is_dir_exists(browser->path)) {
bool skip_assets = (strcmp(archive_get_tab_ext(tab), "*") == 0) ? false : true;
file_browser_worker_set_config(
browser->worker, browser->path, archive_get_tab_ext(tab), skip_assets);
archive_file_browser_set_path(
browser, browser->path, archive_get_tab_ext(tab), skip_assets);
tab_empty = false; // Empty check will be performed later
} else {
tab_empty = true;
Expand Down
1 change: 0 additions & 1 deletion applications/archive/helpers/archive_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key);
void archive_enter_dir(ArchiveBrowserView* browser, string_t name);
void archive_leave_dir(ArchiveBrowserView* browser);
void archive_refresh_dir(ArchiveBrowserView* browser);
void archive_file_browser_set_callbacks(ArchiveBrowserView* browser);
33 changes: 10 additions & 23 deletions applications/archive/helpers/archive_favorites.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ uint16_t archive_favorites_count(void* context) {
static bool archive_favourites_rescan() {
string_t buffer;
string_init(buffer);
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
File* fav_item_file = storage_file_alloc(fs_api);
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);

bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
if(result) {
Expand All @@ -101,13 +100,8 @@ static bool archive_favourites_rescan() {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(buffer));
}
} else {
bool file_exists = storage_file_open(
fav_item_file, string_get_cstr(buffer), FSAM_READ, FSOM_OPEN_EXISTING);
if(file_exists) {
storage_file_close(fav_item_file);
if(storage_file_exists(storage, string_get_cstr(buffer))) {
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", string_get_cstr(buffer));
} else {
storage_file_close(fav_item_file);
}
}
}
Expand All @@ -116,12 +110,11 @@ static bool archive_favourites_rescan() {
string_clear(buffer);

storage_file_close(file);
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
storage_common_rename(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
storage_common_remove(fs_api, ARCHIVE_FAV_TEMP_PATH);
storage_common_remove(storage, ARCHIVE_FAV_PATH);
storage_common_rename(storage, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
storage_common_remove(storage, ARCHIVE_FAV_TEMP_PATH);

storage_file_free(file);
storage_file_free(fav_item_file);
furi_record_close(RECORD_STORAGE);

return result;
Expand All @@ -131,9 +124,8 @@ bool archive_favorites_read(void* context) {
furi_assert(context);

ArchiveBrowserView* browser = context;
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
File* fav_item_file = storage_file_alloc(fs_api);
Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage);

string_t buffer;
FileInfo file_info;
Expand Down Expand Up @@ -163,16 +155,12 @@ bool archive_favorites_read(void* context) {
need_refresh = true;
}
} else {
bool file_exists = storage_file_open(
fav_item_file, string_get_cstr(buffer), FSAM_READ, FSOM_OPEN_EXISTING);
if(file_exists) {
storage_common_stat(fs_api, string_get_cstr(buffer), &file_info);
storage_file_close(fav_item_file);
if(storage_file_exists(storage, string_get_cstr(buffer))) {
storage_common_stat(storage, string_get_cstr(buffer), &file_info);
archive_add_file_item(
browser, (file_info.flags & FSF_DIRECTORY), string_get_cstr(buffer));
file_count++;
} else {
storage_file_close(fav_item_file);
need_refresh = true;
}
}
Expand All @@ -183,7 +171,6 @@ bool archive_favorites_read(void* context) {
storage_file_close(file);
string_clear(buffer);
storage_file_free(file);
storage_file_free(fav_item_file);
furi_record_close(RECORD_STORAGE);

archive_set_item_count(browser, file_count);
Expand Down
9 changes: 3 additions & 6 deletions applications/archive/views/archive_browser_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,18 +370,15 @@ ArchiveBrowserView* browser_alloc() {
return true;
});

browser->worker = file_browser_worker_alloc(browser->path, "*", false);
archive_file_browser_set_callbacks(browser);

file_browser_worker_set_callback_context(browser->worker, browser);

return browser;
}

void browser_free(ArchiveBrowserView* browser) {
furi_assert(browser);

file_browser_worker_free(browser->worker);
if(browser->worker_running) {
file_browser_worker_free(browser->worker);
}

with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
Expand Down
1 change: 1 addition & 0 deletions applications/archive/views/archive_browser_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typedef enum {
struct ArchiveBrowserView {
View* view;
BrowserWorker* worker;
bool worker_running;
ArchiveBrowserViewCallback callback;
void* context;
string_t path;
Expand Down
Empty file modified applications/bad_usb/views/bad_usb_view.h
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion applications/bt/bt_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <applications/cli/cli.h>
#include <lib/toolbox/args.h>

#include "ble.h"
#include <ble/ble.h>
#include "bt_settings.h"
#include "bt_service/bt.h"

Expand Down
Empty file modified applications/bt/bt_debug_app/views/bt_carrier_test.c
100755 → 100644
Empty file.
Empty file modified applications/bt/bt_debug_app/views/bt_test.c
100755 → 100644
Empty file.
Empty file modified applications/bt/bt_debug_app/views/bt_test.h
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions applications/bt/bt_hid_app/bt_hid.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ BtHid* bt_hid_app_alloc() {
app->submenu, "Keynote", BtHidSubmenuIndexKeynote, bt_hid_submenu_callback, app);
submenu_add_item(
app->submenu, "Keyboard", BtHidSubmenuIndexKeyboard, bt_hid_submenu_callback, app);
submenu_add_item(
app->submenu, "Media Player", BtHidSubmenuIndexMedia, bt_hid_submenu_callback, app);
submenu_add_item(app->submenu, "Media", BtHidSubmenuIndexMedia, bt_hid_submenu_callback, app);
submenu_add_item(app->submenu, "Mouse", BtHidSubmenuIndexMouse, bt_hid_submenu_callback, app);
view_set_previous_callback(submenu_get_view(app->submenu), bt_hid_exit);
view_dispatcher_add_view(
Expand Down Expand Up @@ -134,7 +133,8 @@ BtHid* bt_hid_app_alloc() {
app->view_dispatcher, BtHidViewMouse, bt_hid_mouse_get_view(app->bt_hid_mouse));

// TODO switch to menu after Media is done
view_dispatcher_switch_to_view(app->view_dispatcher, BtHidViewKeynote);
app->view_id = BtHidViewSubmenu;
view_dispatcher_switch_to_view(app->view_dispatcher, app->view_id);

return app;
}
Expand Down
7 changes: 5 additions & 2 deletions applications/bt/bt_hid_app/views/bt_hid_keynote.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ static void bt_hid_keynote_draw_callback(Canvas* canvas, void* context) {
}
canvas_set_font(canvas, FontPrimary);
elements_multiline_text_aligned(canvas, 17, 3, AlignLeft, AlignTop, "Keynote");

canvas_draw_icon(canvas, 68, 2, &I_Pin_back_arrow_10x8);
canvas_set_font(canvas, FontSecondary);
elements_multiline_text_aligned(canvas, 127, 3, AlignRight, AlignTop, "Hold to exit");

// Up
canvas_draw_icon(canvas, 21, 24, &I_Button_18x18);
Expand Down Expand Up @@ -97,8 +100,8 @@ static void bt_hid_keynote_draw_callback(Canvas* canvas, void* context) {
elements_slightly_rounded_box(canvas, 66, 47, 60, 13);
canvas_set_color(canvas, ColorWhite);
}
canvas_draw_icon(canvas, 110, 49, &I_Ok_btn_9x9);
elements_multiline_text_aligned(canvas, 76, 56, AlignLeft, AlignBottom, "Back");
canvas_draw_icon(canvas, 74, 49, &I_Pin_back_arrow_10x8);
elements_multiline_text_aligned(canvas, 91, 57, AlignLeft, AlignBottom, "Back");
}

static void bt_hid_keynote_process(BtHidKeynote* bt_hid_keynote, InputEvent* event) {
Expand Down
Loading

0 comments on commit 0545d5e

Please sign in to comment.