From aaf09f4a9cf98c34cd5375515db143a81ca01a2c Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 10 Feb 2023 13:06:11 +0100 Subject: [PATCH] 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 --- connectcore-demo-example/demoserver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connectcore-demo-example/demoserver.py b/connectcore-demo-example/demoserver.py index 5d58eb7..0f07e1f 100755 --- a/connectcore-demo-example/demoserver.py +++ b/connectcore-demo-example/demoserver.py @@ -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