3
3
4
4
// enum SettingsIndex {
5
5
// SettingsIndexBip39Strength = 10,
6
+ // SettingsIndexBip44Coin,
6
7
// SettingsIndexHaptic,
7
8
// SettingsIndexValue1,
8
- // SettingsIndexValue2,
9
9
// };
10
10
11
11
const char * const haptic_text [2 ] = {
@@ -17,15 +17,6 @@ const uint32_t haptic_value[2] = {
17
17
FlipBipHapticOn ,
18
18
};
19
19
20
- // const char* const speaker_text[2] = {
21
- // "OFF",
22
- // "ON",
23
- // };
24
- // const uint32_t speaker_value[2] = {
25
- // FlipBipSpeakerOff,
26
- // FlipBipSpeakerOn,
27
- // };
28
-
29
20
const char * const led_text [2 ] = {
30
21
"OFF" ,
31
22
"ON" ,
@@ -46,20 +37,22 @@ const uint32_t bip39_strength_value[3] = {
46
37
FlipBipStrength256 ,
47
38
};
48
39
40
+ const char * const bip44_coin_text [2 ] = {
41
+ "BTC" ,
42
+ "ETH" ,
43
+ };
44
+ const uint32_t bip44_coin_value [2 ] = {
45
+ FlipBipCoinBTC0 ,
46
+ FlipBipCoinETH60 ,
47
+ };
48
+
49
49
static void flipbip_scene_settings_set_haptic (VariableItem * item ) {
50
50
FlipBip * app = variable_item_get_context (item );
51
51
uint8_t index = variable_item_get_current_value_index (item );
52
52
variable_item_set_current_value_text (item , haptic_text [index ]);
53
53
app -> haptic = haptic_value [index ];
54
54
}
55
55
56
- // static void flipbip_scene_settings_set_speaker(VariableItem* item) {
57
- // FlipBip* app = variable_item_get_context(item);
58
- // uint8_t index = variable_item_get_current_value_index(item);
59
- // variable_item_set_current_value_text(item, speaker_text[index]);
60
- // app->speaker = speaker_value[index];
61
- // }
62
-
63
56
static void flipbip_scene_settings_set_led (VariableItem * item ) {
64
57
FlipBip * app = variable_item_get_context (item );
65
58
uint8_t index = variable_item_get_current_value_index (item );
@@ -74,6 +67,13 @@ static void flipbip_scene_settings_set_bip39_strength(VariableItem* item) {
74
67
app -> bip39_strength = bip39_strength_value [index ];
75
68
}
76
69
70
+ static void flipbip_scene_settings_set_bip44_coin (VariableItem * item ) {
71
+ FlipBip * app = variable_item_get_context (item );
72
+ uint8_t index = variable_item_get_current_value_index (item );
73
+ variable_item_set_current_value_text (item , bip44_coin_text [index ]);
74
+ app -> bip44_coin = bip44_coin_value [index ];
75
+ }
76
+
77
77
void flipbip_scene_settings_submenu_callback (void * context , uint32_t index ) {
78
78
FlipBip * app = context ;
79
79
view_dispatcher_send_custom_event (app -> view_dispatcher , index );
@@ -95,6 +95,17 @@ void flipbip_scene_settings_on_enter(void* context) {
95
95
variable_item_set_current_value_index (item , value_index );
96
96
variable_item_set_current_value_text (item , bip39_strength_text [value_index ]);
97
97
98
+ // BIP44 Coin
99
+ item = variable_item_list_add (
100
+ app -> variable_item_list ,
101
+ "BIP44 Coin:" ,
102
+ 2 ,
103
+ flipbip_scene_settings_set_bip44_coin ,
104
+ app );
105
+ value_index = value_index_uint32 (app -> bip44_coin , bip44_coin_value , 2 );
106
+ variable_item_set_current_value_index (item , value_index );
107
+ variable_item_set_current_value_text (item , bip44_coin_text [value_index ]);
108
+
98
109
// Vibro on/off
99
110
item = variable_item_list_add (
100
111
app -> variable_item_list ,
@@ -106,17 +117,6 @@ void flipbip_scene_settings_on_enter(void* context) {
106
117
variable_item_set_current_value_index (item , value_index );
107
118
variable_item_set_current_value_text (item , haptic_text [value_index ]);
108
119
109
- // // Sound on/off
110
- // item = variable_item_list_add(
111
- // app->variable_item_list,
112
- // "Sound:",
113
- // 2,
114
- // flipbip_scene_settings_set_speaker,
115
- // app);
116
- // value_index = value_index_uint32(app->speaker, speaker_value, 2);
117
- // variable_item_set_current_value_index(item, value_index);
118
- // variable_item_set_current_value_text(item, speaker_text[value_index]);
119
-
120
120
// LED Effects on/off
121
121
item = variable_item_list_add (
122
122
app -> variable_item_list ,
0 commit comments