Skip to content

Commit

Permalink
Merge pull request #8 from jaylikesbunda/v1.0.7
Browse files Browse the repository at this point in the history
V1.0.7
  • Loading branch information
Spooks4576 authored Nov 2, 2024
2 parents a0c698a + fa31a76 commit ee5370b
Show file tree
Hide file tree
Showing 9 changed files with 544 additions and 357 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ A Flipper Zero application for interfacing with the Ghost ESP32 firmware
- Made by [Spooky](https://github.com/Spooks4576)
- Additional contributions by [Jay Candel](https://github.com/jaylikesbunda)


## Support
- For support, please open an [issue](https://github.com/Spooks4576/ghost_esp_app/issues) on the repository or contact [Jay](https://github.com/jaylikesbunda) (@fuckyoudeki on Discord) or [Spooky](https://github.com/Spooks4576).




7 changes: 4 additions & 3 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
App(
appid="ghost_esp", # Must be unique
name="[ESP32] Ghost ESP", # Displayed in menus
apptype=FlipperAppType.EXTERNAL,
apptype=FlipperAppType.EXTERNAL, # type: ignore
entry_point="ghost_esp_app",
stack_size=3 * 1024,
stack_size=6 * 1024,
fap_category="GPIO/ESP",
# Optional values
fap_version="0.1",
icon="A_GhostESP_14",
fap_version="1.0.7",
fap_icon="ghost_esp.png", # 10x10 1-bit PNG
fap_icon_assets="images", # Image assets to compile for this application
)
13 changes: 8 additions & 5 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
- Added 'App Info' Button in Settings
- Misc Changes (mostly to UI)


## v1.0.5
- Commands will silently fail if UART isn't working rather than crashing
- Fixed double-free memory issue by removing stream buffer cleanup from the worker thread
Expand All @@ -43,7 +42,6 @@
- Optimized storage initialization by deferring file operations until needed
- Improved directory creation efficiency in storage handling


## v1.0.6
- Replaced 'Info' command in ESP Check with 'Stop'
- Slightly improved optional UART filtering
Expand All @@ -54,10 +52,15 @@
- Renamed CONF menu option to SET to better align with actual Settings menu since it's header is "Settings" and there is a configuration submenu
- Replaced textbox for ESP Connection Check with scrollable Confirmation View

## TODO
## v1.0.7
- Increased buffers and stacks: MAX_BUFFER_SIZE to 8KB, INITIAL_BUFFER_SIZE to 4KB, BUFFER_CLEAR_SIZE to 128B, uart/app stacks to 4KB/6KB
- Added buffer_mutex with proper timeout handling
- Added Marauder-style data handling
- Improved ESP connection reliability
- Added view log from start/end configuration setting
- Added line buffering with overflow detection, boundary protection and pre-flush on mode switches

## TODO
- Replaced select a utility text with prompt to show NEW Help Menu
- Add view log from start/end configuration setting
- Settings get sent to board and get pulled from on ESP Check or Init
- IMPROVE optional filtering to UART output
- Improve directory organisation!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10 changes: 10 additions & 0 deletions settings_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const char* const SETTING_VALUE_NAMES_RGB_MODE[] = {"Stealth", "Normal", "Rainbo
const char* const SETTING_VALUE_NAMES_CHANNEL_HOP[] = {"500ms", "1000ms", "2000ms", "3000ms", "4000ms"};
const char* const SETTING_VALUE_NAMES_BOOL[] = {"False", "True"};
const char* const SETTING_VALUE_NAMES_ACTION[] = {"Press OK", "Press OK"};
const char* const SETTING_VALUE_NAMES_LOG_VIEW[] = {"End", "Start"};

#include "settings_ui.h" // Add this include at the top

Expand Down Expand Up @@ -100,6 +101,15 @@ const SettingMetadata SETTING_METADATA[SETTINGS_COUNT] = {
.callback = NULL
},
.is_action = true
},
[SETTING_VIEW_LOGS_FROM_START] = {
.name = "View Logs From",
.data.setting = {
.max_value = 1,
.value_names = SETTING_VALUE_NAMES_LOG_VIEW, // We'll define this
.uart_command = NULL // No UART command needed since this is handled locally
},
.is_action = false
}
};
// Update the function signature to include the is_action flag
Expand Down
2 changes: 2 additions & 0 deletions settings_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef enum {
SETTING_ENABLE_RANDOM_BLE_MAC,
SETTING_STOP_ON_BACK,
SETTING_ENABLE_FILTERING,
SETTING_VIEW_LOGS_FROM_START,
SETTING_SHOW_INFO,
SETTING_REBOOT_ESP,
SETTING_CLEAR_LOGS,
Expand Down Expand Up @@ -50,6 +51,7 @@ typedef struct {
uint8_t enable_random_ble_mac_index;
uint8_t stop_on_back_index;
uint8_t enable_filtering_index;
uint8_t view_logs_from_start_index;
uint8_t reboot_esp_index;
uint8_t clear_logs_index;
uint8_t clear_nvs_index;
Expand Down
11 changes: 10 additions & 1 deletion settings_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ bool settings_set(Settings* settings, SettingKey key, uint8_t value, void* conte
}
}
break;
case SETTING_VIEW_LOGS_FROM_START:
if(settings->view_logs_from_start_index != value) {
settings->view_logs_from_start_index = value;
changed = true;
}
break;

default:
return false;
Expand Down Expand Up @@ -211,6 +217,9 @@ uint8_t settings_get(const Settings* settings, SettingKey key) {

case SETTING_ENABLE_FILTERING:
return settings->enable_filtering_index;

case SETTING_VIEW_LOGS_FROM_START:
return settings->view_logs_from_start_index;

case SETTING_REBOOT_ESP:
case SETTING_CLEAR_LOGS:
Expand Down Expand Up @@ -382,7 +391,7 @@ bool settings_custom_event_callback(void* context, uint32_t event_id) {
"Updated by: Jay Candel\n"
"Built with <3";

confirmation_view_set_header(app_state->confirmation_view, "Ghost ESP v1.0.6");
confirmation_view_set_header(app_state->confirmation_view, "Ghost ESP v1.0.7");
confirmation_view_set_text(app_state->confirmation_view, info_text);

// Save current view before switching
Expand Down
1 change: 1 addition & 0 deletions uart_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct UartStorageContext {
UartContext* parentContext;
bool HasOpenedFile;
bool IsWritingToFile;
bool view_logs_from_start;
};

UartStorageContext* uart_storage_init(UartContext* parentContext);
Expand Down
Loading

0 comments on commit ee5370b

Please sign in to comment.