jkearins / ESP32_mkfatfs

Prepare FAT image on host and flash to ESP32.
Apache License 2.0
44 stars 12 forks source link

Unneeded variables in main.cpp #2

Closed loboris closed 7 years ago

loboris commented 7 years ago

Not an issue, it causes no error, but the variables s_pageSize and s_blockSize in _ESP32mkfatfs/components/mkfatfs/src/main.cpp are not used and mkfatfs arguments -p and -b are not needed. You can remove:

static int s_imageSize;
static int s_pageSize;
...
...
    TCLAP::ValueArg<int> pageSizeArg( "p", "page", "fs page size, in bytes", false, 256, "number" );
    TCLAP::ValueArg<int> blockSizeArg( "b", "block", "fs block size, in bytes", false, 4096, "number" );
...
...
    cmd.add( pageSizeArg );
    cmd.add( blockSizeArg );
...
...
    s_pageSize  = pageSizeArg.getValue();
    s_blockSize = blockSizeArg.getValue();

If you make the changes, you must remove (lines 13 & 19) -b $(CONFIG_FATFS_LOG_BLOCK_SIZE) -p $(CONFIG_FATFS_LOG_PAGE_SIZE) from _ESP32mkfatfs/components/mkfatfs/Makefile.projbuild

You can also remove:

config FATFS_LOG_BLOCK_SIZE
    int "FATFS Logical block size"
    range 4096 65536
    default 4096

config FATFS_LOG_PAGE_SIZE
    int "FATFS Logical page size"
    range 256 2048
    default 256
    help
    Set it to the phisycal page size of the used SPI Flash chip.

from _ESP32mkfatfs/main/Kconfig.projbuild.

Thank you for the great work, I've included it also in my MicroPython port.

jkearins commented 7 years ago

Done, the repository is updated. Thanks for warm words :)