diff --git a/bdk/libs/fatfs/diskio.h b/bdk/libs/fatfs/diskio.h index 6959fb4..5b23027 100644 --- a/bdk/libs/fatfs/diskio.h +++ b/bdk/libs/fatfs/diskio.h @@ -59,6 +59,7 @@ DRESULT disk_set_info (BYTE pdrv, BYTE cmd, void *buff); #define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */ #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */ #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */ +#define SET_SECTOR_OFFSET 5 /* Set media logical offset */ /* Generic command (Not used by FatFs) */ #define CTRL_POWER 5 /* Get/Set power status */ diff --git a/bdk/utils/util.h b/bdk/utils/util.h index 924ee2a..68da865 100644 --- a/bdk/utils/util.h +++ b/bdk/utils/util.h @@ -54,6 +54,8 @@ typedef enum #define byte_swap_32(num) ((((num) >> 24) & 0xff) | (((num) << 8) & 0xff0000) | \ (((num) >> 8 )& 0xff00) | (((num) << 24) & 0xff000000)) +#define byte_swap_16(num) ((((num) >> 8) & 0xff) | (((num) << 8) & 0xff00)) + typedef struct _cfg_op_t { u32 off; diff --git a/nyx/nyx_gui/nyx.c b/nyx/nyx_gui/nyx.c index 09e369f..8d85f50 100644 --- a/nyx/nyx_gui/nyx.c +++ b/nyx/nyx_gui/nyx.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2018 naehrwert * - * Copyright (c) 2018-2019 CTCaer + * Copyright (c) 2018-2021 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -42,6 +42,7 @@ #include #include #include +#include "storage/nx_emmc.h" #include #include #include @@ -80,15 +81,12 @@ char *emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_ // Get actual eMMC S/N. if (!storage) { - sdmmc_t sdmmc; - sdmmc_storage_t storage2; - - if (!sdmmc_storage_init_mmc(&storage2, &sdmmc, SDMMC_BUS_WIDTH_8, SDHCI_TIMING_MMC_HS400)) + if (!sdmmc_storage_init_mmc(&emmc_storage, &emmc_sdmmc, SDMMC_BUS_WIDTH_8, SDHCI_TIMING_MMC_HS400)) strcpy(emmc_sn, "00000000"); else { - itoa(storage2.cid.serial, emmc_sn, 16); - sdmmc_storage_end(&storage2); + itoa(emmc_storage.cid.serial, emmc_sn, 16); + sdmmc_storage_end(&emmc_storage); } } else