Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Feb 12, 2023
2 parents 5cf46d2 + 5d8acc2 commit 49e458f
Show file tree
Hide file tree
Showing 22 changed files with 441 additions and 282 deletions.
41 changes: 4 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,8 @@
### New changes
* API: Due to OFW changes API was updated to 14.x, extra pack was updated you can install it separatly or use build with extra pack included
* SubGHz: **Fixed bug in SubGHz HAL, now CC1101 shutdowns properly, (also this fixed unstable TX)**
* SubGHz: **Alutech AT-4N** encoder (support for sending signals) (by @assasinfil | PR #322)
* SubGHz: **KingGates Stylo 4k** encoder (support for sending signals) (by @assasinfil | PR #321)
* SubGHz: Added Debug Pin setting for protocol development and fixed debug (and sound) with internal module
* SubGHz: GUI Fixes
* SubGHz: Removed bugged Detect RAW feature, now its replaced with BinRAW
* Plugins: SubGHz Bruteforcer - Added support for Linear Delta-3 310MHz
* Plugins: Fix CTRL-SHIFT in mousejacker (by @notmarek | PR #316)
* Infrared: Update universal remote assets (by @amec0e) (PR #318)
* NFC: Add Mifare Classic keys (by @Bon-Jorik (scaff.walker) | PR #324)
* Misc: Playing games now affect Flipper's level
* OFW: Fixed typo in nfc_magic_scene_wrong_card.c
* OFW: SubGhz: fix cc1101_read_fifo func
* OFW: feat: add missing `const` qualifiers
* OFW: **SubGhz: add protocol BinRAW (binarization of data quantized by the minimum correlated duration)**
* OFW: Picopass: show elite key used from dictionary
* OFW: Firmware fixes and improvements for flashing via blackmagic
* OFW: fbt: building fap_dist for compact gh build; accessor: fixed for latest ibutton changes
* OFW: Move CSN space to revent overflow
* OFW: **SubGhz: add protocol KingGates Stylo4k**
* OFW: **SubGhz: add protocol Nice One**
* OFW: **SubGhz: add protocol Alutech at-4n**
* OFW: **SubGhz: add DOOYA protocol**
* OFW: **SubGhz: add protocol "Linear Delta-3"**
* OFW: **SubGhz: Fix Raw write, add short duration filter setting**
* OFW: Update Missing SD Card icon from PR 2373
* OFW: SCons: do not include backup files in build
* OFW: Fix minor UI inconsistencies and bugs
* OFW: Allow use of any suitable pin for 1-Wire devices
* OFW: **SD over SPI improvements**
* OFW: Multitarget support for fbt (includes support for non released yet flipper hardware)
* OFW: Pin Reset
* OFW: nfc: Add mifare classic value block commands
* OFW: battery info temperature shown in C or F based on settings
* OFW: Script that can find programmer and flash firmware via it.
* OFW: **SPI Mem Manager C port** (You can use flipper as programmer to flash supported chips)
* iButton: **Temp Fix of non working emulation on Metakom and Cyfral protocols**
* Archive and FileBrowser: **Sort files and folders alphabetically.** Added a "Internal" tab to the Browser (only in DEBUG mode), other misc changes (by @ClaraCrazy and @Willy-JL | PR #327)
* SubGHz: Custom modulation for lrs pagers and added frequency 467.75 to default list (by @jbohack | PR #328)
* SubGHz: **Small fixes in SubGHz HAL**

#### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)

Expand Down
20 changes: 17 additions & 3 deletions applications/main/archive/helpers/archive_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <gui/modules/file_browser_worker.h>
#include <fap_loader/fap_loader_app.h>
#include <math.h>
#include <furi_hal.h>

static void
archive_folder_open_cb(void* context, uint32_t item_cnt, int32_t file_idx, bool is_root) {
Expand Down Expand Up @@ -65,7 +66,13 @@ static void
archive_add_file_item(browser, is_folder, furi_string_get_cstr(item_path));
} else {
with_view_model(
browser->view, ArchiveBrowserViewModel * model, { model->list_loading = false; }, true);
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_sort(model->files);
model->list_loading = false;
},
true);
}
}

Expand Down Expand Up @@ -140,7 +147,7 @@ void archive_update_focus(ArchiveBrowserView* browser, const char* target) {
archive_get_items(browser, furi_string_get_cstr(browser->path));

if(!archive_file_get_array_size(browser) && archive_is_home(browser)) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
} else {
with_view_model(
browser->view,
Expand Down Expand Up @@ -207,7 +214,7 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) {
false);

if((items_cnt == 0) && (archive_is_home(browser))) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
}

archive_update_offset(browser);
Expand Down Expand Up @@ -456,6 +463,13 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
if(tab == ArchiveTabInternal && !furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
if(key == InputKeyLeft) {
tab = ((tab - 1) + ArchiveTabTotal) % ArchiveTabTotal;
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
}

browser->is_root = true;
archive_set_tab(browser, tab);
Expand Down
4 changes: 3 additions & 1 deletion applications/main/archive/helpers/archive_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../archive_i.h"
#include <storage/storage.h>

#define TAB_RIGHT InputKeyRight // Default tab switch direction
#define TAB_LEFT InputKeyLeft // Default tab switch direction
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
#define FILE_LIST_BUF_LEN 50

Expand All @@ -17,6 +17,7 @@ static const char* tab_default_paths[] = {
[ArchiveTabBadUsb] = ANY_PATH("badusb"),
[ArchiveTabU2f] = "/app:u2f",
[ArchiveTabApplications] = ANY_PATH("apps"),
[ArchiveTabInternal] = STORAGE_INT_PATH_PREFIX,
[ArchiveTabBrowser] = STORAGE_ANY_PATH_PREFIX,
};

Expand Down Expand Up @@ -44,6 +45,7 @@ static const ArchiveFileTypeEnum known_type[] = {
[ArchiveTabBadUsb] = ArchiveFileTypeBadUsb,
[ArchiveTabU2f] = ArchiveFileTypeU2f,
[ArchiveTabApplications] = ArchiveFileTypeApplication,
[ArchiveTabInternal] = ArchiveFileTypeUnknown,
[ArchiveTabBrowser] = ArchiveFileTypeUnknown,
};

Expand Down
31 changes: 24 additions & 7 deletions applications/main/archive/helpers/archive_files.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <m-array.h>
#include <furi.h>
#include <m-algo.h>
#include <storage/storage.h>
#include "toolbox/path.h"

Expand Down Expand Up @@ -81,13 +82,29 @@ static void ArchiveFile_t_clear(ArchiveFile_t* obj) {
furi_string_free(obj->custom_name);
}

ARRAY_DEF(
files_array,
ArchiveFile_t,
(INIT(API_2(ArchiveFile_t_init)),
SET(API_6(ArchiveFile_t_set)),
INIT_SET(API_6(ArchiveFile_t_init_set)),
CLEAR(API_2(ArchiveFile_t_clear))))
static int ArchiveFile_t_cmp(const ArchiveFile_t* a, const ArchiveFile_t* b) {
if(a->type == ArchiveFileTypeFolder && b->type != ArchiveFileTypeFolder) {
return -1;
}
if(a->type != ArchiveFileTypeFolder && b->type == ArchiveFileTypeFolder) {
return 1;
}

return furi_string_cmpi(a->path, b->path);
}

#define M_OPL_ArchiveFile_t() \
(INIT(API_2(ArchiveFile_t_init)), \
SET(API_6(ArchiveFile_t_set)), \
INIT_SET(API_6(ArchiveFile_t_init_set)), \
CLEAR(API_2(ArchiveFile_t_clear)), \
CMP(API_6(ArchiveFile_t_cmp)), \
SWAP(M_SWAP_DEFAULT), \
EQUAL(API_6(M_EQUAL_DEFAULT)))

ARRAY_DEF(files_array, ArchiveFile_t)

ALGO_DEF(files_array, ARRAY_OPLIST(files_array, M_OPL_ArchiveFile_t()))

void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder, bool is_app);
bool archive_get_items(void* context, const char* path);
Expand Down
1 change: 1 addition & 0 deletions applications/main/archive/views/archive_browser_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const char* ArchiveTabNames[] = {
[ArchiveTabBadUsb] = "Bad USB",
[ArchiveTabU2f] = "U2F",
[ArchiveTabApplications] = "Apps",
[ArchiveTabInternal] = "Internal",
[ArchiveTabBrowser] = "Browser",
};

Expand Down
7 changes: 5 additions & 2 deletions applications/main/archive/views/archive_browser_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

#include "../helpers/archive_files.h"
#include "../helpers/archive_favorites.h"
#include "../helpers/archive_menu.h"

#include <gui/gui_i.h>
#include <gui/view.h>
#include <gui/canvas.h>
#include <gui/elements.h>
#include <gui/modules/file_browser_worker.h>
#include <storage/storage.h>
#include <furi.h>
#include "../helpers/archive_files.h"
#include "../helpers/archive_menu.h"
#include "../helpers/archive_favorites.h"
#include "gui/modules/file_browser_worker.h"

#define MAX_LEN_PX 110
#define MAX_NAME_LEN 255
Expand All @@ -29,6 +31,7 @@ typedef enum {
ArchiveTabBadUsb,
ArchiveTabU2f,
ArchiveTabApplications,
ArchiveTabInternal,
ArchiveTabBrowser,
ArchiveTabTotal,
} ArchiveTabEnum;
Expand Down
21 changes: 16 additions & 5 deletions applications/main/subghz/subghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,38 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {

flipper_format_free(temp_fm_preset2);

// # HND - FM presets
// Pagers
FlipperFormat* temp_fm_preset3 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset3,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
(const char*)"02 0D 07 04 08 32 0B 06 10 64 11 93 12 0C 13 02 14 00 15 15 18 18 19 16 1B 07 1C 00 1D 91 20 FB 21 56 22 10 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset3);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset3);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"Pagers", temp_fm_preset3);

flipper_format_free(temp_fm_preset3);

// # HND - FM presets
FlipperFormat* temp_fm_preset4 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset4,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset4);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset4);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset4);

flipper_format_free(temp_fm_preset4);

FlipperFormat* temp_fm_preset5 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset5,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset5);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset5);

flipper_format_free(temp_fm_preset5);

// custom presets loading - end

// Load last used values for Read, Read RAW, etc. or default
Expand Down
4 changes: 2 additions & 2 deletions applications/main/subghz/views/subghz_frequency_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const uint32_t subghz_frequency_list[] = {
310000000, 312000000, 312100000, 313000000, 313850000, 314000000, 314350000, 314980000,
315000000, 318000000, 330000000, 345000000, 348000000, 350000000, 387000000, 390000000,
418000000, 433075000, 433220000, 433420000, 433657070, 433889000, 433920000, 434075000,
434176948, 434390000, 434420000, 434775000, 438900000, 440175000, 464000000, 779000000,
434176948, 434390000, 434420000, 434775000, 438900000, 440175000, 464000000, 467750000, 779000000,
868350000, 868400000, 868800000, 868950000, 906400000, 915000000, 925000000, 928000000};

typedef enum {
Expand Down Expand Up @@ -645,4 +645,4 @@ SubGHzFrequencyAnalyzerFeedbackLevel subghz_frequency_analyzer_feedback_level(
float subghz_frequency_analyzer_get_trigger_level(SubGhzFrequencyAnalyzer* instance) {
furi_assert(instance);
return subghz_frequency_analyzer_worker_get_trigger_level(instance->worker);
}
}
5 changes: 4 additions & 1 deletion applications/main/subghz/views/subghz_test_carrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
furi_hal_subghz_rx();
} else {
furi_hal_gpio_init(
furi_hal_subghz.cc1101_g0_pin, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
furi_hal_subghz.cc1101_g0_pin,
GpioModeOutputPushPull,
GpioPullNo,
GpioSpeedLow);
furi_hal_gpio_write(furi_hal_subghz.cc1101_g0_pin, true);
if(!furi_hal_subghz_tx()) {
furi_hal_gpio_init(
Expand Down
60 changes: 48 additions & 12 deletions applications/services/gui/modules/file_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <core/check.h>
#include <core/common_defines.h>
#include <core/log.h>
#include "m-algo.h"
#include <m-array.h>

#define LIST_ITEMS 5u
Expand Down Expand Up @@ -77,13 +78,36 @@ static void BrowserItem_t_clear(BrowserItem_t* obj) {
}
}

ARRAY_DEF(
items_array,
BrowserItem_t,
(INIT(API_2(BrowserItem_t_init)),
SET(API_6(BrowserItem_t_set)),
INIT_SET(API_6(BrowserItem_t_init_set)),
CLEAR(API_2(BrowserItem_t_clear))))
static int BrowserItem_t_cmp(const BrowserItem_t* a, const BrowserItem_t* b) {
// Back indicator comes before everything, then folders, then all other files.
if(a->type == BrowserItemTypeBack) {
return -1;
}
if(b->type == BrowserItemTypeBack) {
return 1;
}
if(a->type == BrowserItemTypeFolder && b->type != BrowserItemTypeFolder) {
return -1;
}
if(a->type != BrowserItemTypeFolder && b->type == BrowserItemTypeFolder) {
return 1;
}

return furi_string_cmpi(a->path, b->path);
}

#define M_OPL_BrowserItem_t() \
(INIT(API_2(BrowserItem_t_init)), \
SET(API_6(BrowserItem_t_set)), \
INIT_SET(API_6(BrowserItem_t_init_set)), \
CLEAR(API_2(BrowserItem_t_clear)), \
CMP(API_6(BrowserItem_t_cmp)), \
SWAP(M_SWAP_DEFAULT), \
EQUAL(API_6(M_EQUAL_DEFAULT)))

ARRAY_DEF(items_array, BrowserItem_t)

ALGO_DEF(items_array, ARRAY_OPLIST(items_array, M_OPL_BrowserItem_t()))

struct FileBrowser {
View* view;
Expand Down Expand Up @@ -438,7 +462,13 @@ static void
}
} else {
with_view_model(
browser->view, FileBrowserModel * model, { model->list_loading = false; }, true);
browser->view,
FileBrowserModel * model,
{
items_array_sort(model->items);
model->list_loading = false;
},
true);
}
}

Expand Down Expand Up @@ -485,19 +515,25 @@ static void browser_draw_list(Canvas* canvas, FileBrowserModel* model) {
for(uint32_t i = 0; i < MIN(model->item_cnt, LIST_ITEMS); i++) {
int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u);

BrowserItemType item_type = BrowserItemTypeLoading;
BrowserItemType item_type;
uint8_t* custom_icon_data = NULL;

if(browser_is_item_in_array(model, idx)) {
BrowserItem_t* item = items_array_get(
model->items, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0));
item_type = item->type;
furi_string_set(filename, item->display_name);
if(item_type == BrowserItemTypeFile) {
custom_icon_data = item->custom_icon_data;
if(model->list_loading && item_type != BrowserItemTypeBack) {
furi_string_set(filename, "---");
item_type = BrowserItemTypeLoading;
} else {
furi_string_set(filename, item->display_name);
if(item_type == BrowserItemTypeFile) {
custom_icon_data = item->custom_icon_data;
}
}
} else {
furi_string_set(filename, "---");
item_type = BrowserItemTypeLoading;
}

if(item_type == BrowserItemTypeBack) {
Expand Down
Loading

0 comments on commit 49e458f

Please sign in to comment.