diff options
| author | 朱天龙 (Armink) <[email protected]> | 2023-07-30 16:18:44 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2023-07-31 18:12:37 -0400 |
| commit | e00e2d55ce35b84289c7900906dcf878466c3286 (patch) | |
| tree | 37ec2140c5886a072b30591147667453d03a92c1 | |
| parent | 51100ae4a6654ba2402daecde0047a99667441ea (diff) | |
[components][fal] remove some assert.
| -rw-r--r-- | components/fal/src/fal_partition.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/components/fal/src/fal_partition.c b/components/fal/src/fal_partition.c index 92ae074303..a26a018a28 100644 --- a/components/fal/src/fal_partition.c +++ b/components/fal/src/fal_partition.c @@ -321,7 +321,8 @@ _exit: */ const struct fal_partition *fal_partition_find(const char *name) { - assert(init_ok); + if (!init_ok) + return NULL; size_t i; @@ -353,9 +354,11 @@ static const struct fal_flash_dev *flash_device_find_by_part(const struct fal_pa */ const struct fal_partition *fal_get_partition_table(size_t *len) { - assert(init_ok); assert(len); + if (!init_ok) + return NULL; + *len = partition_table_len; return partition_table; @@ -370,9 +373,14 @@ const struct fal_partition *fal_get_partition_table(size_t *len) */ void fal_set_partition_table_temp(struct fal_partition *table, size_t len) { - assert(init_ok); assert(table); + if (!init_ok) + { + log_e("FAL NOT initialized"); + return; + } + check_and_update_part_cache(table, len); partition_table_len = len; @@ -400,7 +408,7 @@ int fal_partition_read(const struct fal_partition *part, uint32_t addr, uint8_t if (addr + size > part->len) { - log_e("Partition read error! Partition address out of bound."); + log_e("Partition read error! Partition(%s) address(0x%08x) out of bound(0x%08x).", part->name, addr + size, part->len); return -1; } |
