connectcore-demo-example: fix get storage size in demo server

File '/proc/mtd' may exist in the file system although with no data. So, first
check the emmc file '/sys/class/mmc_host/mmc0/mmc0:0001/block/mmcblk0/size'.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
This commit is contained in:
Tatiana Leon 2023-02-10 13:06:11 +01:00
parent 6ff808bc80
commit aaf09f4a9c
1 changed files with 2 additions and 2 deletions

View File

@ -1138,10 +1138,10 @@ def get_storage_size():
Returns:
Integer: The internal storage size, -1 if fails.
"""
if os.path.exists(NAND_SIZE_FILE):
return get_nand_size()
if os.path.exists(EMMC_SIZE_FILE):
return get_emmc_size()
if os.path.exists(NAND_SIZE_FILE):
return get_nand_size()
return -1