Skip to content

Commit

Permalink
Merge remote-tracking branch 'mntm/dev' into mntm-pr-35
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Nov 27, 2024
2 parents db19deb + 97e2239 commit 4d100c1
Show file tree
Hide file tree
Showing 171 changed files with 9,944 additions and 2,797 deletions.
2 changes: 1 addition & 1 deletion avr_isp/.gitsubtree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://github.com/xMasterX/all-the-plugins dev base_pack/avr_isp_programmer 4558d74c9da36abc851edd96a95d18f7d5511a75
https://github.com/xMasterX/all-the-plugins dev base_pack/avr_isp_programmer 17bec3e26b8250c59acebd4fa52b6b08f68152d7
https://github.com/flipperdevices/flipperzero-good-faps dev avr_isp_programmer b791dea234f855155027bb46215dc60f3ddeb243
1 change: 1 addition & 0 deletions avr_isp/helpers/avr_isp_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static const CdcCallbacks cdc_cb = {
vcp_state_callback,
vcp_on_cdc_control_line,
vcp_on_line_config,
NULL,
};

/* VCP callbacks */
Expand Down
19 changes: 18 additions & 1 deletion flip_library/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## v1.3
Refactored by Derek Jamison:
- Improved progress display.
- Added connectivity check on startup.
- Added Wikipedia API.

## v1.2
- Improved memory allocation.
- Added in Dog Facts.
- Added in Random Quotes.

## v1.1
- Update for app catalog.

## v1.0
- Initial Release.

## v1.2
- Improved memory allocation.
- Added in Dog Facts.
Expand All @@ -7,4 +24,4 @@
- Update for app catalog.

## v1.0
- Initial Release.
- Initial Release.
6 changes: 3 additions & 3 deletions flip_library/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
The **FlipLibrary** app for Flipper Zero is a versatile and user-friendly application that offers a combination of useful features to enhance your Flipper Zero experience.

The app includes a **dictionary**, **random facts**, and additional functionalities, all accessible directly from your Flipper Zero device. It is designed for easy navigation and quick access to information, making it a handy companion for on-the-go learning and entertainment.
The app includes a **dictionary**, **random facts**, and additional functionalities, all accessible directly from your Flipper Zero device. It is designed for easy navigation and quick access to information, making it a handy companion for on-the-go learning and entertainment. Big shout out to [Derek Jamison](https://github.com/jamisonderek) for his contributions.

FlipLibrary uses the FlipperHTTP flash for the WiFi Devboard, first introduced in the WebCrawler app: https://github.com/jblanked/WebCrawler-FlipperZero/tree/main/assets/FlipperHTTP


## Requirements
- WiFi Dev Board or Raspberry Pi Pico W for Flipper Zero with FlipperHTTP Flash: https://github.com/jblanked/FlipperHTTP
- WiFi Developer Board or Raspberry Pi Pico W with FlipperHTTP Flash: https://github.com/jblanked/FlipperHTTP
- WiFi Access Point


Expand Down Expand Up @@ -38,4 +38,4 @@ The app automatically allocates necessary resources and initializes settings. If
# Known Bugs

1. **Screen Delay**: Occasionally, the Defition or Random Facts screen may get stuck on "Loading".
- If it takes longer than 10 seconds, restart your Flipper Zero.
- Update to version 1.3 or higher.
65 changes: 28 additions & 37 deletions flip_library/alloc/flip_library_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FlipLibraryApp* flip_library_app_alloc() {
// Allocate the text input buffer
app->uart_text_input_buffer_size_ssid = 64;
app->uart_text_input_buffer_size_password = 64;
app->uart_text_input_buffer_size_dictionary = 64;
app->uart_text_input_buffer_size_query = 64;
if(!easy_flipper_set_buffer(
&app->uart_text_input_buffer_ssid, app->uart_text_input_buffer_size_ssid)) {
return NULL;
Expand All @@ -33,67 +33,51 @@ FlipLibraryApp* flip_library_app_alloc() {
return NULL;
}
if(!easy_flipper_set_buffer(
&app->uart_text_input_buffer_dictionary, app->uart_text_input_buffer_size_dictionary)) {
&app->uart_text_input_buffer_query, app->uart_text_input_buffer_size_query)) {
return NULL;
}
if(!easy_flipper_set_buffer(
&app->uart_text_input_temp_buffer_dictionary,
app->uart_text_input_buffer_size_dictionary)) {
&app->uart_text_input_temp_buffer_query, app->uart_text_input_buffer_size_query)) {
return NULL;
}

// Allocate ViewDispatcher
if(!easy_flipper_set_view_dispatcher(&app->view_dispatcher, gui, app)) {
return NULL;
}
view_dispatcher_set_custom_event_callback(
app->view_dispatcher, flip_library_custom_event_callback);

// Main view
if(!easy_flipper_set_view(
&app->view_random_facts,
FlipLibraryViewRandomFactsRun,
view_draw_callback_random_facts,
&app->view_loader,
FlipLibraryViewLoader,
flip_library_loader_draw_callback,
NULL,
callback_to_random_facts,
&app->view_dispatcher,
app)) {
return NULL;
}
if(!easy_flipper_set_view(
&app->view_dictionary,
FlipLibraryViewDictionaryRun,
view_draw_callback_dictionary_run,
NULL,
callback_to_submenu,
&app->view_dispatcher,
app)) {
return NULL;
}
flip_library_loader_init(app->view_loader);

// Widget
if(!easy_flipper_set_widget(
&app->widget,
&app->widget_about,
FlipLibraryViewAbout,
"FlipLibrary v1.2\n-----\nDictionary, random facts, and\nmore.\n-----\nwww.github.com/jblanked",
"FlipLibrary v1.3\n-----\nDictionary, random facts, and\nmore.\n-----\nwww.github.com/jblanked",
callback_to_submenu,
&app->view_dispatcher)) {
return NULL;
}
if(!easy_flipper_set_widget(
&app->widget_random_fact,
FlipLibraryViewRandomFactWidget,
&app->widget_result,
FlipLibraryViewWidgetResult,
"Error, try again.",
callback_to_random_facts,
&app->view_dispatcher)) {
return NULL;
}
if(!easy_flipper_set_widget(
&app->widget_dictionary,
FlipLibraryViewDictionaryWidget,
"Error, try again.",
callback_to_submenu,
&app->view_dispatcher)) {
return NULL;
}

// Text Input
if(!easy_flipper_set_uart_text_input(
Expand Down Expand Up @@ -121,12 +105,12 @@ FlipLibraryApp* flip_library_app_alloc() {
return NULL;
}
if(!easy_flipper_set_uart_text_input(
&app->uart_text_input_dictionary,
FlipLibraryViewDictionaryTextInput,
"Enter a word",
app->uart_text_input_temp_buffer_dictionary,
app->uart_text_input_buffer_size_dictionary,
text_updated_dictionary,
&app->uart_text_input_query,
FlipLibraryViewTextInputQuery,
"Enter Query",
app->uart_text_input_temp_buffer_query,
app->uart_text_input_buffer_size_query,
text_updated_query,
callback_to_submenu,
&app->view_dispatcher,
app)) {
Expand Down Expand Up @@ -155,7 +139,7 @@ FlipLibraryApp* flip_library_app_alloc() {
if(!easy_flipper_set_submenu(
&app->submenu_main,
FlipLibraryViewSubmenuMain,
"FlipLibrary v1.2",
"FlipLibrary v1.3",
callback_exit_app,
&app->view_dispatcher)) {
return NULL;
Expand All @@ -175,6 +159,12 @@ FlipLibraryApp* flip_library_app_alloc() {
FlipLibrarySubmenuIndexRandomFacts,
callback_submenu_choices,
app);
submenu_add_item(
app->submenu_main,
"Wikipedia",
FlipLibrarySubmenuIndexRandomFactsWiki,
callback_submenu_choices,
app);
submenu_add_item(
app->submenu_main,
"Dictionary",
Expand Down Expand Up @@ -218,9 +208,10 @@ FlipLibraryApp* flip_library_app_alloc() {
app->uart_text_input_buffer_password,
app->uart_text_input_buffer_size_password)) {
// Update variable items
if(app->variable_item_ssid)
if(app->variable_item_ssid) {
variable_item_set_current_value_text(
app->variable_item_ssid, app->uart_text_input_buffer_ssid);
}
// dont show password

// Copy items into their temp buffers with safety checks
Expand Down
27 changes: 27 additions & 0 deletions flip_library/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ int32_t flip_library_app(void* p) {
return -1;
}

if(app_instance->uart_text_input_buffer_ssid != NULL &&
app_instance->uart_text_input_buffer_password != NULL) {
// Try to wait for pong response.
uint8_t counter = 10;
while(fhttp.state == INACTIVE && --counter > 0) {
FURI_LOG_D(TAG, "Waiting for PONG");
furi_delay_ms(100);
}

if(counter == 0) {
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
DialogMessage* message = dialog_message_alloc();
dialog_message_set_header(
message, "[FlipperHTTP Error]", 64, 0, AlignCenter, AlignTop);
dialog_message_set_text(
message,
"Ensure your WiFi Developer\nBoard or Pico W is connected\nand the latest FlipperHTTP\nfirmware is installed.",
0,
63,
AlignLeft,
AlignBottom);
dialog_message_show(dialogs, message);
dialog_message_free(message);
furi_record_close(RECORD_DIALOGS);
}
}

// Run the view dispatcher
view_dispatcher_run(app_instance->view_dispatcher);

Expand Down
2 changes: 1 addition & 1 deletion flip_library/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ App(
fap_description="Dictionary, random facts, and more.",
fap_author="JBlanked",
fap_weburl="https://github.com/jblanked/FlipLibrary",
fap_version="1.2",
fap_version="1.3.1",
)
Loading

0 comments on commit 4d100c1

Please sign in to comment.