Skip to content

Commit

Permalink
fix: remove led
Browse files Browse the repository at this point in the history
  • Loading branch information
sc committed Aug 9, 2023
1 parent 8cb7f09 commit 1057242
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 104 deletions.
1 change: 0 additions & 1 deletion flipbip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 0 additions & 6 deletions flipbip.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ typedef struct {
FlipBipScene1* flipbip_scene_1;
// Settings options
int haptic;
int led;
int bip39_strength;
int passphrase;
// Main menu options
Expand All @@ -61,11 +60,6 @@ typedef enum {
FlipBipHapticOn,
} FlipBipHapticState;

typedef enum {
FlipBipLedOff,
FlipBipLedOn,
} FlipBipLedState;

typedef enum {
FlipBipStrength128,
FlipBipStrength192,
Expand Down
39 changes: 0 additions & 39 deletions helpers/flipbip_led.c

This file was deleted.

2 changes: 0 additions & 2 deletions helpers/flipbip_led.h

This file was deleted.

27 changes: 0 additions & 27 deletions helpers/flipbip_speaker.c

This file was deleted.

4 changes: 0 additions & 4 deletions helpers/flipbip_speaker.h

This file was deleted.

12 changes: 12 additions & 0 deletions scenes/flipbip_scene_menu.c
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -9,6 +11,7 @@ enum SubmenuIndex {
SubmenuIndexScene1New,
SubmenuIndexScene1Import,
SubmenuIndexSettings,
SubmenuIndexNOP,
};

void flipbip_scene_menu_submenu_callback(void* context, uint32_t index) {
Expand All @@ -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(
Expand Down Expand Up @@ -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;
Expand Down
23 changes: 0 additions & 23 deletions scenes/flipbip_scene_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
3 changes: 1 addition & 2 deletions views/flipbip_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1057242

Please sign in to comment.