Fix (not) asking to make sure to flash in scripts

This commit is contained in:
Such Meme, Many Skill
2020-05-08 20:57:26 +02:00
parent 73ca98c6a8
commit 19fe7f15a9
5 changed files with 17 additions and 9 deletions

View File

@@ -17,7 +17,7 @@
extern sdmmc_storage_t storage;
extern emmc_part_t *system_part;
int emmcRestorePart(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part){
int emmcRestorePart(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part, bool warnings){
FIL fp;
FILINFO fno;
u8 *buf;
@@ -54,10 +54,10 @@ int emmcRestorePart(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part){
gfx_printf("Flashing %s\n", part->name);
if (totalSize < totalSizeDest){
if (totalSize < totalSizeDest && warnings){
SWAPCOLOR(COLOR_ORANGE);
gfx_printf("File is too small for destination.\nDo you want to flash it anyway?\n\nB to Cancel\n");
u8 btnres = gfx_makewaitmenu(
u32 btnres = gfx_makewaitmenu(
"A to Confirm",
3
);
@@ -214,13 +214,13 @@ emmc_part_t *mmcFindPart(char *path, short mmcType){
return NULL;
}
int mmcFlashFile(char *path, short mmcType){
int mmcFlashFile(char *path, short mmcType, bool warnings){
emmc_part_t *part;
int res;
part = mmcFindPart(path, mmcType);
if (part != NULL){
res = emmcRestorePart(path, &storage, part);
res = emmcRestorePart(path, &storage, part, warnings);
emummc_storage_set_mmc_partition(&storage, 0);
return res;
}