From 15d4c8ffb0f0c658a5f810ed414541694b66657d Mon Sep 17 00:00:00 2001 From: MatthewKuKanich Date: Wed, 11 Oct 2023 17:16:22 -0400 Subject: [PATCH] updated to match merge --- .../external/barcode_gen/barcode_app.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/applications/external/barcode_gen/barcode_app.c b/applications/external/barcode_gen/barcode_app.c index aff437f2e..9dde93931 100644 --- a/applications/external/barcode_gen/barcode_app.c +++ b/applications/external/barcode_gen/barcode_app.c @@ -2,6 +2,9 @@ #include "barcode_app_icons.h" #include +#include +#include +#include /** * Opens a file browser dialog and returns the filepath of the selected file @@ -11,6 +14,9 @@ * file_path will be the folder path is nothing is selected * @returns true if a file is selected */ + +NotificationApp* notifications = 0; + static bool select_file(const char* folder, FuriString* file_path) { DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS); DialogsFileBrowserOptions browser_options; @@ -287,6 +293,12 @@ void free_app(BarcodeApp* app) { free(app); } +void set_backlight_brightness(float brightness) { + NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION); + notifications->settings.display_brightness = brightness; + notification_message(notifications, &sequence_display_backlight_on); +} + int32_t barcode_main(void* p) { UNUSED(p); BarcodeApp* app = malloc(sizeof(BarcodeApp)); @@ -307,6 +319,13 @@ int32_t barcode_main(void* p) { submenu_add_item(app->main_menu, "Edit Barcode", EditBarcodeItem, submenu_callback, app); + NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION); + // Save original brightness + float originalBrightness = notifications->settings.display_brightness; + // force backlight and increase brightness + notification_message_block(notifications, &sequence_display_backlight_enforce_on); + set_backlight_brightness(10); // set to highest + /***************************** * Creating Text Input View ******************************/ @@ -344,6 +363,8 @@ int32_t barcode_main(void* p) { view_dispatcher_run(app->view_dispatcher); free_app(app); + notification_message_block(notifications, &sequence_display_backlight_enforce_auto); + set_backlight_brightness(originalBrightness); return 0; }