/* Erases the flash sectors encompassed by parameters passed into function. 
This function erases the appropriate number of flash sectors based on the desired start address and length.  */
status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key)
/* Erases the flash sectors encompassed by parameters passed into function. 
This function erases the appropriate number of flash sectors based on the desired start address and length.  */
status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key)
{
    if (get_rom_api_version() == 0u)
    {
        function_command_option_t runCmdFuncOption;
        runCmdFuncOption.commandAddr = 0x1300413bU;
        return runCmdFuncOption.eraseCommand(config, start, lengthInBytes, key);
    }
    else
    {
        return VERSION1_FLASH_API_TREE->flash_erase(config, start, lengthInBytes, key);
    }
}