/* FAL (Flash Abstraction Layer) initialization. It will initialize all flash device and all flash partition. */
int fal_init(void)
/* FAL (Flash Abstraction Layer) initialization. It will initialize all flash device and all flash partition. */
int fal_init(void)
{
    extern int fal_flash_init(void);
    extern int fal_partition_init(void);
    int result;
    result = fal_flash_init();
    if (result < 0) {
        goto __exit;
    }
    result = fal_partition_init();
__exit:
    if ((result > 0) && (!init_ok))
    {
        init_ok = 1;
        log_i("RT-Thread Flash Abstraction Layer initialize success.");
    }
    else if(result <= 0)
    {
        init_ok = 0;
        log_e("RT-Thread Flash Abstraction Layer initialize failed.");
    }
    return result;
}