mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
nyx: Create bootloader folder on screenshots if missing
This commit is contained in:
parent
1c19a69e35
commit
b5df428e43
1 changed files with 11 additions and 5 deletions
|
@ -276,7 +276,9 @@ static void _save_fb_to_bmp()
|
||||||
|
|
||||||
char path[0x80];
|
char path[0x80];
|
||||||
|
|
||||||
strcpy(path, "bootloader/screenshots");
|
strcpy(path, "bootloader");
|
||||||
|
f_mkdir(path);
|
||||||
|
strcat(path, "/screenshots");
|
||||||
f_mkdir(path);
|
f_mkdir(path);
|
||||||
|
|
||||||
// Create date/time name.
|
// Create date/time name.
|
||||||
|
@ -289,10 +291,11 @@ static void _save_fb_to_bmp()
|
||||||
max77620_rtc_epoch_to_date(epoch, &time);
|
max77620_rtc_epoch_to_date(epoch, &time);
|
||||||
}
|
}
|
||||||
s_printf(fname, "%04d%02d%02d_%02d%02d%02d", time.year, time.month, time.day, time.hour, time.min, time.sec);
|
s_printf(fname, "%04d%02d%02d_%02d%02d%02d", time.year, time.month, time.day, time.hour, time.min, time.sec);
|
||||||
|
|
||||||
s_printf(path + strlen(path), "/nyx%s.bmp", fname);
|
s_printf(path + strlen(path), "/nyx%s.bmp", fname);
|
||||||
sd_save_to_file(bitmap, file_size, path);
|
|
||||||
|
|
||||||
|
// Save screenshot and log.
|
||||||
|
int res = sd_save_to_file(bitmap, file_size, path);
|
||||||
|
if (!res)
|
||||||
_save_log_to_bmp(fname);
|
_save_log_to_bmp(fname);
|
||||||
|
|
||||||
sd_unmount();
|
sd_unmount();
|
||||||
|
@ -300,7 +303,10 @@ static void _save_fb_to_bmp()
|
||||||
free(bitmap);
|
free(bitmap);
|
||||||
free(fb);
|
free(fb);
|
||||||
|
|
||||||
|
if (!res)
|
||||||
lv_mbox_set_text(mbox, SYMBOL_CAMERA" #96FF00 Screenshot saved!#");
|
lv_mbox_set_text(mbox, SYMBOL_CAMERA" #96FF00 Screenshot saved!#");
|
||||||
|
else
|
||||||
|
lv_mbox_set_text(mbox, SYMBOL_WARNING" #FFDD00 Screenshot failed!#");
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
lv_mbox_start_auto_close(mbox, 4000);
|
lv_mbox_start_auto_close(mbox, 4000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue