Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/nyx/nyx_gui/frontend/gui_emmc_tools.c
1476 views
1
/*
2
* Copyright (c) 2018-2020 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#include <stdlib.h>
18
19
#include <bdk.h>
20
21
#include "gui.h"
22
#include "gui_emmc_tools.h"
23
#include "gui_tools.h"
24
#include "fe_emmc_tools.h"
25
#include "../config.h"
26
#include "../hos/pkg1.h"
27
#include "../hos/pkg2.h"
28
#include "../hos/hos.h"
29
#include <libs/fatfs/ff.h>
30
31
extern boot_cfg_t b_cfg;
32
extern hekate_config h_cfg;
33
34
extern char *emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage);
35
36
typedef struct _emmc_backup_buttons_t
37
{
38
lv_obj_t *emmc_boot;
39
lv_obj_t *emmc_raw_gpp;
40
lv_obj_t *emmc_sys;
41
lv_obj_t *emmc_usr;
42
bool raw_emummc;
43
bool restore;
44
} emmc_backup_buttons_t;
45
46
static emmc_backup_buttons_t emmc_btn_ctxt;
47
48
static void _create_window_backup_restore(emmcPartType_t type, const char* win_label)
49
{
50
emmc_tool_gui_t emmc_tool_gui_ctxt;
51
52
emmc_tool_gui_ctxt.raw_emummc = emmc_btn_ctxt.raw_emummc;
53
54
char win_label_full[80];
55
56
s_printf(win_label_full, "%s%s", emmc_btn_ctxt.restore ? SYMBOL_DOWNLOAD" Restore " : SYMBOL_UPLOAD" Backup ", win_label+3);
57
58
lv_obj_t *win = nyx_create_standard_window(win_label_full);
59
60
//Disable buttons.
61
nyx_window_toggle_buttons(win, true);
62
63
// Create important info container.
64
lv_obj_t *h1 = lv_cont_create(win, NULL);
65
lv_cont_set_fit(h1, false, true);
66
lv_obj_set_width(h1, (LV_HOR_RES / 9) * 5);
67
lv_obj_set_click(h1, false);
68
lv_cont_set_layout(h1, LV_LAYOUT_OFF);
69
70
static lv_style_t h_style;
71
lv_style_copy(&h_style, lv_cont_get_style(h1));
72
h_style.body.main_color = LV_COLOR_HEX(0x1d1d1d);
73
h_style.body.grad_color = h_style.body.main_color;
74
h_style.body.opa = LV_OPA_COVER;
75
76
// Create log container.
77
lv_obj_t *h2 = lv_cont_create(win, h1);
78
lv_cont_set_style(h2, &h_style);
79
lv_cont_set_fit(h2, false, false);
80
lv_obj_set_size(h2, (LV_HOR_RES / 11) * 4, LV_DPI * 5);
81
lv_cont_set_layout(h2, LV_LAYOUT_OFF);
82
lv_obj_align(h2, h1, LV_ALIGN_OUT_RIGHT_TOP, 0, LV_DPI / 5);
83
84
lv_obj_t *label_log = lv_label_create(h2, NULL);
85
lv_label_set_recolor(label_log, true);
86
lv_obj_set_style(label_log, &monospace_text);
87
lv_label_set_long_mode(label_log, LV_LABEL_LONG_BREAK);
88
lv_label_set_static_text(label_log, "");
89
lv_obj_set_width(label_log, lv_obj_get_width(h2));
90
lv_obj_align(label_log, h2, LV_ALIGN_IN_TOP_LEFT, LV_DPI / 10, LV_DPI / 10);
91
emmc_tool_gui_ctxt.label_log = label_log;
92
93
lv_obj_t *label_sep = lv_label_create(h1, NULL);
94
lv_label_set_static_text(label_sep, "");
95
96
// Create info elements.
97
lv_obj_t *label_info = lv_label_create(h1, NULL);
98
lv_label_set_recolor(label_info, true);
99
lv_obj_set_width(label_info, lv_obj_get_width(h1));
100
lv_label_set_static_text(label_info, "\n\n\n\n\n\n\n\n\n");
101
lv_obj_set_style(label_info, lv_theme_get_current()->label.prim);
102
lv_obj_align(label_info, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 10);
103
emmc_tool_gui_ctxt.label_info = label_info;
104
105
static lv_style_t bar_teal_bg, bar_teal_ind, bar_white_ind;
106
107
lv_style_copy(&bar_teal_bg, lv_theme_get_current()->bar.bg);
108
bar_teal_bg.body.main_color = LV_COLOR_HEX(0x005a47);
109
bar_teal_bg.body.grad_color = bar_teal_bg.body.main_color;
110
111
lv_style_copy(&bar_teal_ind, lv_theme_get_current()->bar.indic);
112
bar_teal_ind.body.main_color = LV_COLOR_HEX(0x00FFC9);
113
bar_teal_ind.body.grad_color = bar_teal_ind.body.main_color;
114
115
lv_style_copy(&bar_white_ind, lv_theme_get_current()->bar.indic);
116
bar_white_ind.body.main_color = LV_COLOR_HEX(0xF0F0F0);
117
bar_white_ind.body.grad_color = bar_white_ind.body.main_color;
118
119
emmc_tool_gui_ctxt.bar_teal_bg = &bar_teal_bg;
120
emmc_tool_gui_ctxt.bar_teal_ind = &bar_teal_ind;
121
emmc_tool_gui_ctxt.bar_white_ind = &bar_white_ind;
122
123
lv_obj_t *bar = lv_bar_create(h1, NULL);
124
lv_obj_set_size(bar, LV_DPI * 38 / 10, LV_DPI / 5);
125
lv_bar_set_range(bar, 0, 100);
126
lv_bar_set_value(bar, 0);
127
lv_obj_align(bar, label_info, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 8);
128
lv_obj_set_opa_scale(bar, LV_OPA_0);
129
lv_obj_set_opa_scale_enable(bar, true);
130
emmc_tool_gui_ctxt.bar = bar;
131
132
lv_obj_t *label_pct= lv_label_create(h1, NULL);
133
lv_label_set_recolor(label_pct, true);
134
lv_label_set_static_text(label_pct, " "SYMBOL_DOT" 0%");
135
lv_obj_set_style(label_pct, lv_theme_get_current()->label.prim);
136
lv_obj_align(label_pct, bar, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 20, 0);
137
lv_obj_set_opa_scale(label_pct, LV_OPA_0);
138
lv_obj_set_opa_scale_enable(label_pct, true);
139
emmc_tool_gui_ctxt.label_pct = label_pct;
140
141
lv_obj_t *label_finish = lv_label_create(h1, NULL);
142
lv_label_set_recolor(label_finish, true);
143
lv_label_set_static_text(label_finish, "");
144
lv_obj_set_style(label_finish, lv_theme_get_current()->label.prim);
145
lv_obj_align(label_finish, bar, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI * 9 / 20);
146
emmc_tool_gui_ctxt.label_finish = label_finish;
147
148
if (!emmc_btn_ctxt.restore)
149
dump_emmc_selected(type, &emmc_tool_gui_ctxt);
150
else
151
restore_emmc_selected(type, &emmc_tool_gui_ctxt);
152
153
nyx_window_toggle_buttons(win, false);
154
155
// Refresh AutoRCM button.
156
if (emmc_btn_ctxt.restore && (type == PART_BOOT) && !emmc_btn_ctxt.raw_emummc)
157
{
158
if (get_set_autorcm_status(false))
159
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_TGL_REL);
160
else
161
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_REL);
162
nyx_generic_onoff_toggle(autorcm_btn);
163
164
if (h_cfg.rcm_patched)
165
{
166
lv_obj_set_click(autorcm_btn, false);
167
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_INA);
168
}
169
}
170
}
171
172
static lv_res_t _emmc_backup_buttons_decider(lv_obj_t *btn)
173
{
174
if (!nyx_emmc_check_battery_enough())
175
return LV_RES_OK;
176
177
char *win_label = lv_label_get_text(lv_obj_get_child(btn, NULL));
178
179
if (emmc_btn_ctxt.emmc_boot == btn)
180
_create_window_backup_restore(PART_BOOT, win_label);
181
else if (emmc_btn_ctxt.emmc_raw_gpp == btn)
182
_create_window_backup_restore(PART_RAW, win_label);
183
else if (emmc_btn_ctxt.emmc_sys == btn)
184
{
185
if (!emmc_btn_ctxt.restore)
186
_create_window_backup_restore(PART_SYSTEM, win_label);
187
else
188
_create_window_backup_restore(PART_GP_ALL, win_label);
189
}
190
else if (!emmc_btn_ctxt.restore && emmc_btn_ctxt.emmc_usr == btn)
191
_create_window_backup_restore(PART_USER, win_label);
192
193
return LV_RES_OK;
194
}
195
196
static lv_res_t _emmc_backup_buttons_raw_toggle(lv_obj_t *btn)
197
{
198
nyx_generic_onoff_toggle(btn);
199
200
lv_obj_set_click(emmc_btn_ctxt.emmc_boot, true);
201
lv_btn_set_state(emmc_btn_ctxt.emmc_boot, LV_BTN_STATE_REL);
202
lv_obj_set_click(emmc_btn_ctxt.emmc_raw_gpp, true);
203
lv_btn_set_state(emmc_btn_ctxt.emmc_raw_gpp, LV_BTN_STATE_REL);
204
205
lv_obj_set_click(emmc_btn_ctxt.emmc_sys, true);
206
lv_btn_set_state(emmc_btn_ctxt.emmc_sys, LV_BTN_STATE_REL);
207
208
// Backup/Restore from and to eMMC.
209
if (!(lv_btn_get_state(btn) & LV_BTN_STATE_TGL_REL))
210
{
211
if (!emmc_btn_ctxt.restore)
212
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_UPLOAD" eMMC BOOT0 & BOOT1");
213
else
214
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_DOWNLOAD" eMMC BOOT0 & BOOT1");
215
lv_obj_realign(emmc_btn_ctxt.emmc_boot);
216
217
if (!emmc_btn_ctxt.restore)
218
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_UPLOAD" eMMC RAW GPP");
219
else
220
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_DOWNLOAD" eMMC RAW GPP");
221
lv_obj_realign(emmc_btn_ctxt.emmc_raw_gpp);
222
223
if (!emmc_btn_ctxt.restore)
224
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_sys, NULL), SYMBOL_MODULES" eMMC SYS");
225
else
226
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_sys, NULL), SYMBOL_MODULES" eMMC ALL");
227
lv_obj_realign(emmc_btn_ctxt.emmc_sys);
228
229
if (!emmc_btn_ctxt.restore)
230
{
231
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_usr, NULL), SYMBOL_MODULES_ALT" eMMC USER");
232
lv_obj_realign(emmc_btn_ctxt.emmc_usr);
233
234
lv_obj_set_click(emmc_btn_ctxt.emmc_usr, true);
235
lv_btn_set_state(emmc_btn_ctxt.emmc_usr, LV_BTN_STATE_REL);
236
}
237
238
emmc_btn_ctxt.raw_emummc = false;
239
}
240
else // Backup/Restore from and to emuMMC.
241
{
242
if (!emmc_btn_ctxt.restore)
243
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_UPLOAD" SD emuMMC BOOT0 & BOOT1");
244
else
245
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_DOWNLOAD" SD emuMMC BOOT0 & BOOT1");
246
lv_obj_realign(emmc_btn_ctxt.emmc_boot);
247
248
if (!emmc_btn_ctxt.restore)
249
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_UPLOAD" SD emuMMC RAW GPP");
250
else
251
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_DOWNLOAD" SD emuMMC RAW GPP");
252
lv_obj_realign(emmc_btn_ctxt.emmc_raw_gpp);
253
254
lv_obj_set_click(emmc_btn_ctxt.emmc_sys, false);
255
lv_btn_set_state(emmc_btn_ctxt.emmc_sys, LV_BTN_STATE_INA);
256
257
if (!emmc_btn_ctxt.restore)
258
{
259
lv_obj_set_click(emmc_btn_ctxt.emmc_usr, false);
260
lv_btn_set_state(emmc_btn_ctxt.emmc_usr, LV_BTN_STATE_INA);
261
}
262
263
emmc_btn_ctxt.raw_emummc = true;
264
}
265
266
return LV_RES_OK;
267
}
268
269
lv_res_t create_window_backup_restore_tool(lv_obj_t *btn)
270
{
271
lv_obj_t *win;
272
273
emmc_btn_ctxt.restore = false;
274
if (strcmp(lv_label_get_text(lv_obj_get_child(btn, NULL)), SYMBOL_UPLOAD" Backup eMMC"))
275
emmc_btn_ctxt.restore = true;
276
277
if (!emmc_btn_ctxt.restore)
278
win = nyx_create_standard_window(SYMBOL_SD" Backup");
279
else
280
win = nyx_create_standard_window(SYMBOL_SD" Restore");
281
282
static lv_style_t h_style;
283
lv_style_copy(&h_style, &lv_style_transp);
284
h_style.body.padding.inner = 0;
285
h_style.body.padding.hor = LV_DPI - (LV_DPI / 4);
286
h_style.body.padding.ver = LV_DPI / 9;
287
288
// Create Full container.
289
lv_obj_t *h1 = lv_cont_create(win, NULL);
290
lv_cont_set_style(h1, &h_style);
291
lv_cont_set_fit(h1, false, true);
292
lv_obj_set_width(h1, (LV_HOR_RES / 9) * 4);
293
lv_obj_set_click(h1, false);
294
lv_cont_set_layout(h1, LV_LAYOUT_OFF);
295
296
lv_obj_t *label_sep = lv_label_create(h1, NULL);
297
lv_label_set_static_text(label_sep, "");
298
299
lv_obj_t *label_txt = lv_label_create(h1, NULL);
300
lv_label_set_static_text(label_txt, "Full");
301
lv_obj_set_style(label_txt, lv_theme_get_current()->label.prim);
302
lv_obj_align(label_txt, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, -LV_DPI * 3 / 10);
303
304
lv_obj_t *line_sep = lv_line_create(h1, NULL);
305
static const lv_point_t line_pp[] = { {0, 0}, { LV_HOR_RES - (LV_DPI - (LV_DPI / 4)) * 2, 0} };
306
lv_line_set_points(line_sep, line_pp, 2);
307
lv_line_set_style(line_sep, lv_theme_get_current()->line.decor);
308
lv_obj_align(line_sep, label_txt, LV_ALIGN_OUT_BOTTOM_LEFT, -(LV_DPI / 4), LV_DPI / 8);
309
310
// Create BOOT0 & BOOT1 button.
311
lv_obj_t *btn1 = lv_btn_create(h1, NULL);
312
lv_obj_t *label_btn = lv_label_create(btn1, NULL);
313
lv_btn_set_fit(btn1, true, true);
314
if (!emmc_btn_ctxt.restore)
315
lv_label_set_static_text(label_btn, SYMBOL_UPLOAD" eMMC BOOT0 & BOOT1");
316
else
317
lv_label_set_static_text(label_btn, SYMBOL_DOWNLOAD" eMMC BOOT0 & BOOT1");
318
319
lv_obj_align(btn1, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 4);
320
lv_btn_set_action(btn1, LV_BTN_ACTION_CLICK, _emmc_backup_buttons_decider);
321
emmc_btn_ctxt.emmc_boot = btn1;
322
323
lv_obj_t *label_txt2 = lv_label_create(h1, NULL);
324
lv_label_set_recolor(label_txt2, true);
325
if (!emmc_btn_ctxt.restore)
326
{
327
lv_label_set_static_text(label_txt2,
328
"Allows you to backup the BOOT physical partitions.\n"
329
"They contain the BCT, keys and various package1.\n"
330
"#FF8000 These are paired with the RAW GPP backup.#");
331
}
332
else
333
{
334
lv_label_set_static_text(label_txt2,
335
"Allows you to restore the BOOT physical partitions.\n"
336
"They contain the BCT, keys and various package1.\n"
337
"#FF8000 These are paired with the RAW GPP restore.#");
338
}
339
lv_obj_set_style(label_txt2, &hint_small_style);
340
lv_obj_align(label_txt2, btn1, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
341
342
// Create RAW GPP button.
343
lv_obj_t *btn2 = lv_btn_create(h1, btn1);
344
label_btn = lv_label_create(btn2, NULL);
345
if (!emmc_btn_ctxt.restore)
346
lv_label_set_static_text(label_btn, SYMBOL_UPLOAD" eMMC RAW GPP");
347
else
348
lv_label_set_static_text(label_btn, SYMBOL_DOWNLOAD" eMMC RAW GPP");
349
lv_obj_align(btn2, label_txt2, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 2);
350
lv_btn_set_action(btn2, LV_BTN_ACTION_CLICK, _emmc_backup_buttons_decider);
351
emmc_btn_ctxt.emmc_raw_gpp= btn2;
352
353
label_txt2 = lv_label_create(h1, NULL);
354
lv_label_set_recolor(label_txt2, true);
355
if (!emmc_btn_ctxt.restore)
356
{
357
lv_label_set_static_text(label_txt2,
358
"Allows you to backup the GPP physical partition.\n"
359
"It contains, CAL0, various package2, SYSTEM, USER, etc.\n"
360
"#FF8000 This is paired with the BOOT0/1 backups.#");
361
}
362
else
363
{
364
lv_label_set_static_text(label_txt2,
365
"Allows you to restore the GPP physical partition.\n"
366
"It contains, CAL0, various package2, SYSTEM, USER, etc.\n"
367
"#FF8000 This is paired with the BOOT0/1 restore.#");
368
}
369
lv_obj_set_style(label_txt2, &hint_small_style);
370
lv_obj_align(label_txt2, btn2, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
371
372
// Create GPP Partitions container.
373
lv_obj_t *h2 = lv_cont_create(win, NULL);
374
lv_cont_set_style(h2, &h_style);
375
lv_cont_set_fit(h2, false, true);
376
lv_obj_set_width(h2, (LV_HOR_RES / 9) * 4);
377
lv_obj_set_click(h2, false);
378
lv_cont_set_layout(h2, LV_LAYOUT_OFF);
379
lv_obj_align(h2, h1, LV_ALIGN_OUT_RIGHT_TOP, LV_DPI * 17 / 29, 0);
380
381
label_sep = lv_label_create(h2, NULL);
382
lv_label_set_static_text(label_sep, "");
383
384
lv_obj_t *label_txt3 = lv_label_create(h2, NULL);
385
lv_label_set_static_text(label_txt3, "GPP Partitions");
386
lv_obj_set_style(label_txt3, lv_theme_get_current()->label.prim);
387
lv_obj_align(label_txt3, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, -LV_DPI * 4 / 21);
388
389
line_sep = lv_line_create(h2, line_sep);
390
lv_obj_align(line_sep, label_txt3, LV_ALIGN_OUT_BOTTOM_LEFT, -(LV_DPI / 4), LV_DPI / 8);
391
392
// Create SYS/ALL button.
393
lv_obj_t *btn3 = lv_btn_create(h2, NULL);
394
label_btn = lv_label_create(btn3, NULL);
395
lv_btn_set_fit(btn3, true, true);
396
if (!emmc_btn_ctxt.restore)
397
lv_label_set_static_text(label_btn, SYMBOL_MODULES" eMMC SYS");
398
else
399
lv_label_set_static_text(label_btn, SYMBOL_MODULES" eMMC ALL");
400
lv_obj_align(btn3, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 4);
401
lv_btn_set_action(btn3, LV_BTN_ACTION_CLICK, _emmc_backup_buttons_decider);
402
emmc_btn_ctxt.emmc_sys = btn3;
403
404
lv_obj_t *label_txt4 = lv_label_create(h2, NULL);
405
lv_label_set_recolor(label_txt4, true);
406
if (!emmc_btn_ctxt.restore)
407
{
408
lv_label_set_static_text(label_txt4,
409
"Allows you to backup the partitions from RAW GPP except\n"
410
"USER. It contains, CAL0, various package2, SYSTEM, etc.\n"
411
"#FF8000 This is an incomplete backup.#");
412
}
413
else
414
{
415
lv_label_set_static_text(label_txt4,
416
"Allows you to restore ALL partitions from RAW GPP\n"
417
"It contains, CAL0, various package2, SYSTEM, USER, etc.\n");
418
}
419
420
lv_obj_set_style(label_txt4, &hint_small_style);
421
lv_obj_align(label_txt4, btn3, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
422
423
// Create USER button.
424
if (!emmc_btn_ctxt.restore)
425
{
426
lv_obj_t *btn4 = lv_btn_create(h2, btn1);
427
label_btn = lv_label_create(btn4, NULL);
428
lv_label_set_static_text(label_btn, SYMBOL_MODULES_ALT" eMMC USER");
429
lv_obj_align(btn4, label_txt4, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 2);
430
lv_btn_set_action(btn4, LV_BTN_ACTION_CLICK, _emmc_backup_buttons_decider);
431
emmc_btn_ctxt.emmc_usr = btn4;
432
433
label_txt4 = lv_label_create(h2, NULL);
434
lv_label_set_recolor(label_txt4, true);
435
lv_label_set_static_text(label_txt4,
436
"Allows you to backup the USER partition from RAW GPP.\n"
437
"#FF8000 This is an incomplete backup.#\n");
438
lv_obj_set_style(label_txt4, &hint_small_style);
439
lv_obj_align(label_txt4, btn4, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
440
}
441
else
442
{
443
emmc_btn_ctxt.emmc_usr = NULL;
444
}
445
446
// Create eMMC/emuMMC On/Off button.
447
lv_obj_t *h3 = lv_cont_create(win, NULL);
448
lv_cont_set_style(h3, &h_style);
449
lv_cont_set_fit(h3, false, true);
450
lv_obj_set_width(h3, (LV_HOR_RES / 10) * 4);
451
lv_obj_set_click(h3, false);
452
lv_cont_set_layout(h3, LV_LAYOUT_OFF);
453
lv_obj_align(h3, h1, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI * 38 / 11, LV_DPI / 7);
454
455
lv_obj_t *sd_emummc_raw = lv_btn_create(h3, NULL);
456
nyx_create_onoff_button(lv_theme_get_current(), h3,
457
sd_emummc_raw, SYMBOL_SD" SD emuMMC Raw Partition", _emmc_backup_buttons_raw_toggle, false);
458
emmc_btn_ctxt.raw_emummc = false;
459
460
return LV_RES_OK;
461
}
462
463