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 Mar 9, 2023
2 parents 1b12526 + 319108b commit 05489fd
Show file tree
Hide file tree
Showing 393 changed files with 8,068 additions and 5,555 deletions.
3 changes: 3 additions & 0 deletions .pvsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@

# Functions that always return the same error code
//-V:picopass_device_decrypt:1048

# Examples
//V_EXCLUDE_PATH applications/examples/
52 changes: 32 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
### New changes
* If you have copied apps into `apps` folder - remove `apps` folder on your microSD before installing this release to avoid issues!
* SubGHz: Fixed timings for static CAME 12 bit and other types (fixed issue #280)
* SubGHz: Fix #370 and fix other protocol counter issues
* SubGHz: **Custom buttons for Nice Flor S / Somfy Telis (+Programming mode)** - now you can use arrow buttons to send signal with different button code
* SubGHz: Somfy Telis -> Add manually (create new remote, now with programming button (Prog / 0x8) you can write it into receiver)
* SubGHz: BFT Mitto -> Add manually (create new remote, now with programming button (0xF) you can write it into receiver)
* SubGHz: Nice One -> Add manually (programming is possible using regular button)
* SubGHz: More precise settings for debug counter increase value
* Plugins -> MouseJacker: Features, Fixes and improvements (by @MatthisC | PR #366)
* Plugins -> HC-SR04: Improve accuracy by measuring microseconds (by @clashlab | PR #367)
* OFW PR: 2441 - Infrared: Fix hangups on repeated button press (by gsurkov)
* OFW PR: 2440 - Fix navigation on unsupported card types (by Astrrra)
* OFW: BadUSB UI fixes
* OFW: Plugins: move to designated categories -> **We moved some plugins to new categories too**
* OFW: Drivers: remove excessive check in bq25896 and make PVS happy
* OFW: FuriHal, Power, UnitTests: fix, rename battery charging voltage limit API -> **Breaking API change, api was changed from 14.x to 15.x**
* SubGHz: Default custom buttons layout for non standard remotes (for example your remote has broken buttons and transmit only 0xC, now you can use other buttons)
* SubGHz: Fix issues with external module 5v power (now all works automatically, enabling +5v manually not required) (**Only for modules that work with 5v->3.3v converter!!!!!**)
* SubGHz: Option to disable automatic 5v power for external modules - (5v is enabled by default, if you are using module without converter you can set this option to OFF)
* SubGHz: Fix and update subghz protocols to use new error system
* SubGHz: Fix default frequency being overwritten bug (Add manually fixes)
* SubGHz: Fix 464Mhz and (390MHz for external module only) was showing up in Frequency analyzer all the time due to noise
* iButton: Fix ibutton app - add manually - duplicate names
* Plugins: NFC Magic fix - reinit nfc at app start
* Plugins: Update **Unitemp - Temperature sensors reader** (DHT11/22, DS18B20, BMP280, HTU21x and more) [(by quen0n)](https://github.com/quen0n/unitemp-flipperzero)
* Plugins: Update **SWD Probe** [(by g3gg0)](https://github.com/g3gg0/flipper-swd_probe)
* Plugins: Massive plugins refactoring - not full refactoring, only small issues is fixed and moved all plugins to furi mutex instead of valuemutex
* Plugins: Many small issues was found and fixed due mutex upgrade
* Plugins: `Extra pack` updated and fixed (valuemutex to furi_mutex upgrade)
* Plugins: SubGHz playlist - rewind (skip or play previous file) [(by alvarotorijano)](https://github.com/alvarotorijano/playListMod/blob/main/playlistMod.c)
* Plugins: Properly rename unirf remix to subghz remote - And automatically migrate user files to new folder (unirf -> subghz_remote)
* Plugins: Fix unirf freeze (protocol deserialize status ok) (by @Willy-JL | PR #375)
* Plugins: Blackjack game: fix bug counting more than one ace (by @403-Fruit | PR #374)
* Plugins: Update POCSAG Pager app to new error system
* Plugins: Update iButton Fuzzer to new iButton system
* Infrared: Update universal remote assets (by @amec0e | PR #378)
* OFW: PicoPass: auth cleanup
* OFW: More UI fixes and improvements
* OFW: NFC: Support reading Mifare Classic key B from sector trailer, reading sector with B key where A key can't read block, Nfc Magic app not using NFC folder by default (in file select)
* OFW: Remove ValueMutex -> **Breaking API change, api was changed from 17.x to 18.x**
* OFW: Support reseting iCx cards
* OFW: Fixed picopass load save file overrun
* OFW: Fix SD card CID parsing
* OFW: Archive browser: update path on dir leave
* OFW: SubGhz: better and more verbose error handling in protocols, stricter CAME validation -> **Breaking API change, api was changed from 16.x to 17.x**
* OFW: iButton system and app refactoring (+new protocols) -> **Breaking API change, api was changed from 15.x to 16.x**
**(this will make your manually copied plugins not work, update them in same way you installed them, or delete `apps` folder and then install firmware, if you using extra pack builds (with `e` in version) all apps in _Extra will be updated automatically)**

* OFW: Fix incorrect type choise condition in image compressor
* OFW: Updater: handle storage errors when removing files, fix folder remove routine, prevent unused services from starting
* OFW: Unify power info, power debug, and device_info into one info command
* OFW: SD Cache: moved to diskio layer, invalidation in case of error
* OFW: Picopass: factory key support, minor code cleanup
* OFW: New pin reset splashscreen
* OFW: Getter for application data path

#### [🎲 Download latest extra apps pack](https://github.com/xMasterX/unleashed-extra-pack/archive/refs/heads/main.zip)

Expand Down
54 changes: 28 additions & 26 deletions applications/debug/keypad_test/keypad_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef struct {
uint16_t left;
uint16_t right;
uint16_t ok;
FuriMutex* mutex;
} KeypadTestState;

static void keypad_test_reset_state(KeypadTestState* state) {
Expand All @@ -22,7 +23,8 @@ static void keypad_test_reset_state(KeypadTestState* state) {
}

static void keypad_test_render_callback(Canvas* canvas, void* ctx) {
KeypadTestState* state = (KeypadTestState*)acquire_mutex((ValueMutex*)ctx, 25);
KeypadTestState* state = ctx;
furi_mutex_acquire(state->mutex, FuriWaitForever);
canvas_clear(canvas);
char strings[5][20];

Expand Down Expand Up @@ -51,7 +53,7 @@ static void keypad_test_render_callback(Canvas* canvas, void* ctx) {

canvas_draw_str(canvas, 10, 63, "[back] - reset, hold to exit");

release_mutex((ValueMutex*)ctx, state);
furi_mutex_release(state->mutex);
}

static void keypad_test_input_callback(InputEvent* input_event, void* ctx) {
Expand All @@ -64,17 +66,17 @@ int32_t keypad_test_app(void* p) {
FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
furi_check(event_queue);

KeypadTestState _state = {{false, false, false, false, false}, 0, 0, 0, 0, 0};
KeypadTestState state = {{false, false, false, false, false}, 0, 0, 0, 0, 0, NULL};
state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);

ValueMutex state_mutex;
if(!init_mutex(&state_mutex, &_state, sizeof(KeypadTestState))) {
if(!state.mutex) {
FURI_LOG_E(TAG, "cannot create mutex");
return 0;
}

ViewPort* view_port = view_port_alloc();

view_port_draw_callback_set(view_port, keypad_test_render_callback, &state_mutex);
view_port_draw_callback_set(view_port, keypad_test_render_callback, &state);
view_port_input_callback_set(view_port, keypad_test_input_callback, event_queue);

// Open GUI and register view_port
Expand All @@ -83,7 +85,7 @@ int32_t keypad_test_app(void* p) {

InputEvent event;
while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
KeypadTestState* state = (KeypadTestState*)acquire_mutex_block(&state_mutex);
furi_mutex_acquire(state.mutex, FuriWaitForever);
FURI_LOG_I(
TAG,
"key: %s type: %s",
Expand All @@ -92,62 +94,62 @@ int32_t keypad_test_app(void* p) {

if(event.key == InputKeyRight) {
if(event.type == InputTypePress) {
state->press[0] = true;
state.press[0] = true;
} else if(event.type == InputTypeRelease) {
state->press[0] = false;
state.press[0] = false;
} else if(event.type == InputTypeShort) {
++state->right;
++state.right;
}
} else if(event.key == InputKeyLeft) {
if(event.type == InputTypePress) {
state->press[1] = true;
state.press[1] = true;
} else if(event.type == InputTypeRelease) {
state->press[1] = false;
state.press[1] = false;
} else if(event.type == InputTypeShort) {
++state->left;
++state.left;
}
} else if(event.key == InputKeyUp) {
if(event.type == InputTypePress) {
state->press[2] = true;
state.press[2] = true;
} else if(event.type == InputTypeRelease) {
state->press[2] = false;
state.press[2] = false;
} else if(event.type == InputTypeShort) {
++state->up;
++state.up;
}
} else if(event.key == InputKeyDown) {
if(event.type == InputTypePress) {
state->press[3] = true;
state.press[3] = true;
} else if(event.type == InputTypeRelease) {
state->press[3] = false;
state.press[3] = false;
} else if(event.type == InputTypeShort) {
++state->down;
++state.down;
}
} else if(event.key == InputKeyOk) {
if(event.type == InputTypePress) {
state->press[4] = true;
state.press[4] = true;
} else if(event.type == InputTypeRelease) {
state->press[4] = false;
state.press[4] = false;
} else if(event.type == InputTypeShort) {
++state->ok;
++state.ok;
}
} else if(event.key == InputKeyBack) {
if(event.type == InputTypeLong) {
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
break;
} else if(event.type == InputTypeShort) {
keypad_test_reset_state(state);
keypad_test_reset_state(&state);
}
}

release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
view_port_update(view_port);
}

// remove & free all stuff created by app
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
delete_mutex(&state_mutex);
furi_mutex_free(state.mutex);

furi_record_close(RECORD_GUI);

Expand Down
30 changes: 16 additions & 14 deletions applications/debug/text_box_test/text_box_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ static void (*text_box_test_render[])(Canvas* canvas) = {

typedef struct {
uint32_t idx;
FuriMutex* mutex;
} TextBoxTestState;

static void text_box_test_render_callback(Canvas* canvas, void* ctx) {
TextBoxTestState* state = acquire_mutex((ValueMutex*)ctx, 25);
TextBoxTestState* state = ctx;
furi_mutex_acquire(state->mutex, FuriWaitForever);
canvas_clear(canvas);

text_box_test_render[state->idx](canvas);

release_mutex((ValueMutex*)ctx, state);
furi_mutex_release(state->mutex);
}

static void text_box_test_input_callback(InputEvent* input_event, void* ctx) {
Expand All @@ -74,17 +76,17 @@ int32_t text_box_test_app(void* p) {
FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
furi_check(event_queue);

TextBoxTestState _state = {.idx = 0};
TextBoxTestState state = {.idx = 0, .mutex = NULL};
state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);

ValueMutex state_mutex;
if(!init_mutex(&state_mutex, &_state, sizeof(TextBoxTestState))) {
if(!state.mutex) {
FURI_LOG_E(TAG, "Cannot create mutex");
return 0;
}

ViewPort* view_port = view_port_alloc();

view_port_draw_callback_set(view_port, text_box_test_render_callback, &state_mutex);
view_port_draw_callback_set(view_port, text_box_test_render_callback, &state);
view_port_input_callback_set(view_port, text_box_test_input_callback, event_queue);

// Open GUI and register view_port
Expand All @@ -94,32 +96,32 @@ int32_t text_box_test_app(void* p) {
uint32_t test_renders_num = COUNT_OF(text_box_test_render);
InputEvent event;
while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
TextBoxTestState* state = acquire_mutex_block(&state_mutex);
furi_mutex_acquire(state.mutex, FuriWaitForever);

if(event.type == InputTypeShort) {
if(event.key == InputKeyRight) {
if(state->idx < test_renders_num - 1) {
state->idx++;
if(state.idx < test_renders_num - 1) {
state.idx++;
}
} else if(event.key == InputKeyLeft) {
if(state->idx > 0) {
state->idx--;
if(state.idx > 0) {
state.idx--;
}
} else if(event.key == InputKeyBack) {
release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
break;
}
}

release_mutex(&state_mutex, state);
furi_mutex_release(state.mutex);
view_port_update(view_port);
}

// remove & free all stuff created by app
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
furi_message_queue_free(event_queue);
delete_mutex(&state_mutex);
furi_mutex_free(state.mutex);

furi_record_close(RECORD_GUI);

Expand Down
6 changes: 0 additions & 6 deletions applications/debug/unit_tests/furi/furi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

// v2 tests
void test_furi_create_open();
void test_furi_valuemutex();
void test_furi_concurrent_access();
void test_furi_pubsub();

Expand All @@ -30,10 +29,6 @@ MU_TEST(mu_test_furi_create_open) {
test_furi_create_open();
}

MU_TEST(mu_test_furi_valuemutex) {
test_furi_valuemutex();
}

MU_TEST(mu_test_furi_pubsub) {
test_furi_pubsub();
}
Expand All @@ -51,7 +46,6 @@ MU_TEST_SUITE(test_suite) {

// v2 tests
MU_RUN_TEST(mu_test_furi_create_open);
MU_RUN_TEST(mu_test_furi_valuemutex);
MU_RUN_TEST(mu_test_furi_pubsub);
MU_RUN_TEST(mu_test_furi_memmgr);
}
Expand Down
41 changes: 0 additions & 41 deletions applications/debug/unit_tests/furi/furi_valuemutex_test.c

This file was deleted.

9 changes: 4 additions & 5 deletions applications/debug/unit_tests/rpc/rpc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void clean_directory(Storage* fs_api, const char* clean_dir) {
size_t size = strlen(clean_dir) + strlen(name) + 1 + 1;
char* fullname = malloc(size);
snprintf(fullname, size, "%s/%s", clean_dir, name);
if(fileinfo.flags & FSF_DIRECTORY) {
if(file_info_is_dir(&fileinfo)) {
clean_directory(fs_api, fullname);
}
FS_Error error = storage_common_remove(fs_api, fullname);
Expand Down Expand Up @@ -608,9 +608,8 @@ static void test_rpc_storage_list_create_expected_list(
}

if(path_contains_only_ascii(name)) {
list->file[i].type = (fileinfo.flags & FSF_DIRECTORY) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].type = file_info_is_dir(&fileinfo) ? PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].size = fileinfo.size;
list->file[i].data = NULL;
/* memory free inside rpc_encode_and_send() -> pb_release() */
Expand Down Expand Up @@ -873,7 +872,7 @@ static void test_rpc_storage_stat_run(const char* path, uint32_t command_id) {
if(error == FSE_OK) {
response->which_content = PB_Main_storage_stat_response_tag;
response->content.storage_stat_response.has_file = true;
response->content.storage_stat_response.file.type = (fileinfo.flags & FSF_DIRECTORY) ?
response->content.storage_stat_response.file.type = file_info_is_dir(&fileinfo) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
response->content.storage_stat_response.file.size = fileinfo.size;
Expand Down
Loading

0 comments on commit 05489fd

Please sign in to comment.