Skip to content

Commit

Permalink
Fixed bug where crash occurs after deleting an item
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lee committed Jan 30, 2024
1 parent 14db43d commit b64e36d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Current State
- Infrared working
- SubGhz working
- Pause working
- SubGhz in Development
- Edit/Rename/Delete features in development
- IR Timing features in development

## What this is?
This app combines commands used in IR and SubGhz into playlists that can be run with one click
Expand All @@ -30,6 +30,10 @@ Wouldn't it be nicer to simply click one button and let everything happen? This
- Add pauses, becaue target systems are not always fast enough for multiple commands<br>
- Run file containing chained IR & SubGhz commands<br>

### Limitations
SubGhz commands will stop working if you move/rename/delete the original files on your Flipper. This is because
of how the Flippers SubGhz worker expects data.

## How to install on Flipper Zero
- If you do not have one, download a firmware<br>
- Plug your Flipper Zero in via USB. <br>
Expand Down
12 changes: 2 additions & 10 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ App(
name="Cross Remote",
apptype=FlipperAppType.EXTERNAL,
entry_point="xremote_app",
cdefines=["APP_XREMOTE"],
requires=[
"gui",
"storage",
"dialogs",
],
stack_size=3 * 1024,
order=10,
fap_libs=["assets"],
fap_icon="icons/xremote_10px.png",
fap_icon_assets="icons",
fap_version="1.1",
fap_version="2.0",
fap_category="Infrared",
fap_author="Leedave",
fap_description="One-Click, sends multiple commands",
fap_weburl="https://github.com/leedave/Leeds-Flipper-Zero-Applications"
fap_weburl="https://github.com/leedave/flipper-zero-cross-remote"
)
6 changes: 2 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
## Cross Remote

This app combines your IR commands into a playlist that can be run with one click. Pauses can be set inbetween, as IR devices typically are not so fast.
This app combines your IR and SubGhz commands into a playlist that can be run with one click. Pauses can be set inbetween, as IR/SubGhz devices typically are not so fast.

## Features
- Read out commands you recorded in the IR app
- Read out commands you saved as .sub files
- Combine commands to a chain/playlist
- Add pauses inbetween commands
- Save your command chain / playlist to flipper
- Disable LED effects if not wanted
- Configure duration of IR Signals

## In Development
- Ability to also add SubGhz commands

## What good is this?

Example what you command chain (playlist) could do with one click
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- SubGhz Functionality added
- Slight change in Storage format to enalbe individual IR timings later (feature request)
- Fixed more memory leaks
- Fixed error where Flipper crashes after deleting a command chain
- Updated Manifest for better CFW support
- Updated readme for new inputs

## v1.1
- Patched memory leak in storage
Expand Down
5 changes: 2 additions & 3 deletions models/cross/xremote_cross_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,16 @@ bool xremote_cross_remote_save_new(CrossRemote* remote, const char* name) {
static void xremote_cross_remote_reset(CrossRemote* remote) {
furi_string_reset(remote->name);
furi_string_reset(remote->path);
CrossRemoteItemArray_clear(remote->items);
xremote_cross_remote_clear_items(remote);
remote->transmitting = 0;
}

bool xremote_cross_remote_delete(CrossRemote* remote) {
Storage* storage = furi_record_open(RECORD_STORAGE);
FS_Error status = storage_common_remove(storage, furi_string_get_cstr(remote->path));

xremote_cross_remote_reset(remote);

furi_record_close(RECORD_STORAGE);
xremote_cross_remote_reset(remote);
return (status == FSE_OK || status == FSE_NOT_EXIST);
}

0 comments on commit b64e36d

Please sign in to comment.