sc 2 лет назад
Родитель
Сommit
1057242f87

+ 0 - 1
flipbip.c

@@ -104,7 +104,6 @@ FlipBip* flipbip_app_alloc() {
 
     // Settings
     app->haptic = FlipBipHapticOn;
-    app->led = FlipBipLedOn;
     app->bip39_strength = FlipBipStrength256; // 256 bits (24 words)
     app->passphrase = FlipBipPassphraseOff;
 

+ 0 - 6
flipbip.h

@@ -34,7 +34,6 @@ typedef struct {
     FlipBipScene1* flipbip_scene_1;
     // Settings options
     int haptic;
-    int led;
     int bip39_strength;
     int passphrase;
     // Main menu options
@@ -61,11 +60,6 @@ typedef enum {
     FlipBipHapticOn,
 } FlipBipHapticState;
 
-typedef enum {
-    FlipBipLedOff,
-    FlipBipLedOn,
-} FlipBipLedState;
-
 typedef enum {
     FlipBipStrength128,
     FlipBipStrength192,

+ 0 - 39
helpers/flipbip_led.c

@@ -1,39 +0,0 @@
-#include "flipbip_led.h"
-#include "../flipbip.h"
-
-void flipbip_led_set_rgb(void* context, int red, int green, int blue) {
-    FlipBip* app = context;
-    if(app->led != 1) {
-        return;
-    }
-    NotificationMessage notification_led_message_1;
-    notification_led_message_1.type = NotificationMessageTypeLedRed;
-    NotificationMessage notification_led_message_2;
-    notification_led_message_2.type = NotificationMessageTypeLedGreen;
-    NotificationMessage notification_led_message_3;
-    notification_led_message_3.type = NotificationMessageTypeLedBlue;
-
-    notification_led_message_1.data.led.value = red;
-    notification_led_message_2.data.led.value = green;
-    notification_led_message_3.data.led.value = blue;
-    const NotificationSequence notification_sequence = {
-        &notification_led_message_1,
-        &notification_led_message_2,
-        &notification_led_message_3,
-        &message_do_not_reset,
-        NULL,
-    };
-    notification_message(app->notification, &notification_sequence);
-    furi_thread_flags_wait(
-        0, FuriFlagWaitAny, 10); //Delay, prevent removal from RAM before LED value set
-}
-
-void flipbip_led_reset(void* context) {
-    FlipBip* app = context;
-    notification_message(app->notification, &sequence_reset_red);
-    notification_message(app->notification, &sequence_reset_green);
-    notification_message(app->notification, &sequence_reset_blue);
-
-    furi_thread_flags_wait(
-        0, FuriFlagWaitAny, 300); //Delay, prevent removal from RAM before LED value set
-}

+ 0 - 2
helpers/flipbip_led.h

@@ -1,2 +0,0 @@
-void flipbip_led_set_rgb(void* context, int red, int green, int blue);
-void flipbip_led_reset(void* context);

+ 0 - 27
helpers/flipbip_speaker.c

@@ -1,27 +0,0 @@
-// #include "flipbip_speaker.h"
-// #include "../flipbip.h"
-
-// #define NOTE_INPUT 587.33f
-
-// void flipbip_play_input_sound(void* context) {
-//     FlipBip* app = context;
-//     if (app->speaker != 1) {
-//         return;
-//     }
-//     float volume = 1.0f;
-//     if(furi_hal_speaker_is_mine() || furi_hal_speaker_acquire(30)) {
-//         furi_hal_speaker_start(NOTE_INPUT, volume);
-//     }
-
-// }
-
-// void flipbip_stop_all_sound(void* context) {
-//     FlipBip* app = context;
-//     if (app->speaker != 1) {
-//         return;
-//     }
-//     if(furi_hal_speaker_is_mine()) {
-//         furi_hal_speaker_stop();
-//         furi_hal_speaker_release();
-//     }
-// }

+ 0 - 4
helpers/flipbip_speaker.h

@@ -1,4 +0,0 @@
-// #define NOTE_INPUT 587.33f
-
-// void flipbip_play_input_sound(void* context);
-// void flipbip_stop_all_sound(void* context);

+ 12 - 0
scenes/flipbip_scene_menu.c

@@ -1,6 +1,8 @@
 #include "../flipbip.h"
 #include "../helpers/flipbip_file.h"
 
+#define FLIPBIP_MENU_HEADER_TEXT "- FlipBIP wallet " FLIPBIP_VERSION " -"
+
 enum SubmenuIndex {
     SubmenuIndexScene1BTC = 10,
     SubmenuIndexScene1ETH,
@@ -9,6 +11,7 @@ enum SubmenuIndex {
     SubmenuIndexScene1New,
     SubmenuIndexScene1Import,
     SubmenuIndexSettings,
+    SubmenuIndexNOP,
 };
 
 void flipbip_scene_menu_submenu_callback(void* context, uint32_t index) {
@@ -19,6 +22,13 @@ void flipbip_scene_menu_submenu_callback(void* context, uint32_t index) {
 void flipbip_scene_menu_on_enter(void* context) {
     FlipBip* app = context;
 
+    submenu_add_item(
+        app->submenu,
+        FLIPBIP_MENU_HEADER_TEXT,
+        SubmenuIndexNOP,
+        flipbip_scene_menu_submenu_callback,
+        app);
+
     if(flipbip_has_file(FlipBipFileKey, NULL, false) &&
        flipbip_has_file(FlipBipFileDat, NULL, false)) {
         submenu_add_item(
@@ -134,6 +144,8 @@ bool flipbip_scene_menu_on_event(void* context, SceneManagerEvent event) {
                 app->scene_manager, FlipBipSceneMenu, SubmenuIndexSettings);
             scene_manager_next_scene(app->scene_manager, FlipBipSceneSettings);
             return true;
+        } else if(event.event == SubmenuIndexNOP) {
+            return true;
         }
     }
     return false;

+ 0 - 23
scenes/flipbip_scene_settings.c

@@ -15,15 +15,6 @@ const uint32_t haptic_value[2] = {
     FlipBipHapticOn,
 };
 
-const char* const led_text[2] = {
-    TEXT_LABEL_OFF,
-    TEXT_LABEL_ON,
-};
-const uint32_t led_value[2] = {
-    FlipBipLedOff,
-    FlipBipLedOn,
-};
-
 const char* const bip39_strength_text[3] = {
     "12",
     "18",
@@ -51,13 +42,6 @@ static void flipbip_scene_settings_set_haptic(VariableItem* item) {
     app->haptic = haptic_value[index];
 }
 
-static void flipbip_scene_settings_set_led(VariableItem* item) {
-    FlipBip* app = variable_item_get_context(item);
-    uint8_t index = variable_item_get_current_value_index(item);
-    variable_item_set_current_value_text(item, led_text[index]);
-    app->led = led_value[index];
-}
-
 static void flipbip_scene_settings_set_bip39_strength(VariableItem* item) {
     FlipBip* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
@@ -115,13 +99,6 @@ void flipbip_scene_settings_on_enter(void* context) {
     variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, haptic_text[value_index]);
 
-    // LED Effects on/off
-    item = variable_item_list_add(
-        app->variable_item_list, "LED FX:", 2, flipbip_scene_settings_set_led, app);
-    value_index = value_index_uint32(app->led, led_value, 2);
-    variable_item_set_current_value_index(item, value_index);
-    variable_item_set_current_value_text(item, led_text[value_index]);
-
     view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdSettings);
 }
 

+ 1 - 2
views/flipbip_scene_1.c

@@ -8,7 +8,6 @@
 #include <string.h>
 #include "flipbip_icons.h"
 #include "../helpers/flipbip_haptic.h"
-#include "../helpers/flipbip_led.h"
 #include "../helpers/flipbip_string.h"
 #include "../helpers/flipbip_file.h"
 // From: /lib/crypto
@@ -666,7 +665,7 @@ void flipbip_scene_1_enter(void* context) {
 
     flipbip_play_happy_bump(app);
     //notification_message(app->notification, &sequence_blink_cyan_100);
-    flipbip_led_set_rgb(app, 255, 0, 0);
+    //flipbip_led_set_rgb(app, 255, 0, 0);
 
     with_view_model(
         instance->view,