/* Initializes the global flash properties structure members. 
This function checks and initializes the Flash module for the other Flash APIs.  */
status_t FLASH_Init(flash_config_t *config)
/* Initializes the global flash properties structure members. 
This function checks and initializes the Flash module for the other Flash APIs.  */
status_t FLASH_Init(flash_config_t *config)
{
    status_t status;
    config->modeConfig.sysFreqInMHz = (uint32_t)kSysToFlashFreq_defaultInMHz;
    if (get_rom_api_version() == 1u)
    {
        status = VERSION1_FLASH_API_TREE->flash_init(config);
    }
    else
    {
        status = VERSION0_FLASH_API_TREE->flash_init(config);
    }
    if (config->PFlashTotalSize == 0xA0000U)
    {
        config->PFlashTotalSize -= 17U * config->PFlashPageSize;
    }
    return status;
}