From bfecd49b954c4c8f3008c93747a733787508e5d3 Mon Sep 17 00:00:00 2001 From: David Lee Date: Mon, 17 Jun 2024 20:31:28 +0200 Subject: [PATCH] Code Updats for 0.103.1-rc --- application.fam | 2 +- docs/changelog.md | 3 +++ scenes/xremote_scene_ir_timer.c | 5 ----- scenes/xremote_scene_transmit.c | 6 ++++++ scenes/xremote_scene_xr_list.c | 1 - scenes/xremote_scene_xr_list_edit.c | 2 -- views/xremote_transmit.c | 23 +++++++++++++++++++++++ views/xremote_transmit.h | 4 +++- xremote_i.h | 6 +----- 9 files changed, 37 insertions(+), 15 deletions(-) diff --git a/application.fam b/application.fam index afe97b52864..c1cc68609be 100644 --- a/application.fam +++ b/application.fam @@ -6,7 +6,7 @@ App( stack_size=3 * 1024, fap_icon="icons/xremote_10px.png", fap_icon_assets="icons", - fap_version="2.5", + fap_version="2.6", fap_category="Infrared", fap_author="Leedave", fap_description="One-Click, sends multiple commands", diff --git a/docs/changelog.md b/docs/changelog.md index d324e51a972..2d2ab423828 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,6 @@ +## 2.6 +- Fix for conflict wiht SubGHz folder variable in 0.103.1-rc + ## 2.5 - Back button on info screen now reacts the same as ok button - Fixed crash on exit in fw 0.100.3 diff --git a/scenes/xremote_scene_ir_timer.c b/scenes/xremote_scene_ir_timer.c index 41a737c1d9a..ecf440eff6f 100644 --- a/scenes/xremote_scene_ir_timer.c +++ b/scenes/xremote_scene_ir_timer.c @@ -41,11 +41,6 @@ bool xremote_scene_ir_timer_on_event(void* context, SceneManagerEvent event) { if(item->time > 9999) { item->time = 9999; } - //app->first_station = atoi(app->text_store[0]); - /*if(app->first_station > app->max_station) { - app->first_station = app->max_station; - snprintf(app->text_store[0], 5, "%lu", app->first_station); - }*/ scene_manager_previous_scene(app->scene_manager); return true; } diff --git a/scenes/xremote_scene_transmit.c b/scenes/xremote_scene_transmit.c index 6eeaa53bb29..b0e6086f2b5 100644 --- a/scenes/xremote_scene_transmit.c +++ b/scenes/xremote_scene_transmit.c @@ -169,6 +169,12 @@ bool xremote_scene_transmit_on_event(void* context, SceneManagerEvent event) { } } else if(event.type == SceneManagerEventTypeTick) { FURI_LOG_D(TAG, "Tick Event"); + with_view_model( + xremote_transmit_get_view(app->xremote_transmit), + void* model, + { UNUSED(model); }, + true + ); if(app->state_notifications == SubGhzNotificationStateTx && app->led == 1) { //blink for subghz } diff --git a/scenes/xremote_scene_xr_list.c b/scenes/xremote_scene_xr_list.c index 7f069b3785d..e8592d98e13 100644 --- a/scenes/xremote_scene_xr_list.c +++ b/scenes/xremote_scene_xr_list.c @@ -26,7 +26,6 @@ void xremote_scene_xr_list_on_enter(void* context) { if(success) { //Load Remote Button View - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_next_scene(app->scene_manager, XRemoteSceneTransmit); } else { //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); diff --git a/scenes/xremote_scene_xr_list_edit.c b/scenes/xremote_scene_xr_list_edit.c index e4e88b1577a..9050a0e552b 100644 --- a/scenes/xremote_scene_xr_list_edit.c +++ b/scenes/xremote_scene_xr_list_edit.c @@ -21,10 +21,8 @@ void xremote_scene_xr_list_edit_on_enter(void* context) { if(success) { //Load Remote Button View - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_next_scene(app->scene_manager, XRemoteSceneXrListEditItem); } else { - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_previous_scene(app->scene_manager); } } diff --git a/views/xremote_transmit.c b/views/xremote_transmit.c index 3412200e4c1..1613c7a246a 100644 --- a/views/xremote_transmit.c +++ b/views/xremote_transmit.c @@ -100,12 +100,35 @@ void xremote_transmit_draw(Canvas* canvas, XRemoteTransmitModel* model) { } } +bool xremote_transmit_input(InputEvent* event, void* context) { + furi_assert(context); + XRemoteTransmit* instance = context; + if(event->type == InputTypeRelease) { + switch(event->key) { + case InputKeyBack: + with_view_model( + instance->view, + XRemoteTransmitModel * model, + { + UNUSED(model); + instance->callback(XRemoteCustomEventViewTransmitterSendStop, instance->context); + }, + true); + break; + default: + break; + } + } + return true; +} + XRemoteTransmit* xremote_transmit_alloc() { XRemoteTransmit* instance = malloc(sizeof(XRemoteTransmit)); instance->view = view_alloc(); view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(XRemoteTransmitModel)); view_set_context(instance->view, instance); view_set_draw_callback(instance->view, (ViewDrawCallback)xremote_transmit_draw); + view_set_input_callback(instance->view, xremote_transmit_input); view_set_enter_callback(instance->view, xremote_transmit_enter); with_view_model( diff --git a/views/xremote_transmit.h b/views/xremote_transmit.h index 250b742f3d9..5fa483ceb0c 100644 --- a/views/xremote_transmit.h +++ b/views/xremote_transmit.h @@ -21,4 +21,6 @@ void xremote_transmit_free(XRemoteTransmit* instance); View* xremote_transmit_get_view(XRemoteTransmit* instance); -void xremote_transmit_enter(void* context); \ No newline at end of file +void xremote_transmit_enter(void* context); + +bool xremote_transmit_input(InputEvent* event, void* context); \ No newline at end of file diff --git a/xremote_i.h b/xremote_i.h index 5cbcb6aef0f..a760b424605 100644 --- a/xremote_i.h +++ b/xremote_i.h @@ -23,9 +23,6 @@ #include #include #include - -//#include //Not found - #include #include @@ -53,13 +50,12 @@ #define XREMOTE_TEXT_STORE_SIZE 128 #define XREMOTE_MAX_ITEM_NAME_LENGTH 22 #define XREMOTE_MAX_REMOTE_NAME_LENGTH 22 -#define XREMOTE_VERSION "2.5" +#define XREMOTE_VERSION "2.6" #define INFRARED_APP_EXTENSION ".ir" #define INFRARED_APP_FOLDER ANY_PATH("infrared") #define SUBGHZ_APP_EXTENSION ".sub" -#define SUBGHZ_APP_FOLDER ANY_PATH("subghz") #define TAG "XRemote"