Exemple #1
0
int32_t PIOS_Flash_Internal_Init(uintptr_t *chip_id, const struct pios_flash_internal_cfg *cfg)
{
	struct pios_internal_flash_dev *flash_dev;

	flash_dev = PIOS_Flash_Internal_alloc();
	if (flash_dev == NULL)
		return -1;

	flash_dev->transaction_lock = PIOS_Semaphore_Create();

	flash_dev->cfg = cfg;

	*chip_id = (uintptr_t) flash_dev;

	return 0;
}
int32_t PIOS_Flash_Internal_Init(uintptr_t * flash_id, const struct pios_flash_internal_cfg * cfg)
{
	struct pios_internal_flash_dev * flash_dev;

	flash_dev = PIOS_Flash_Internal_alloc();
	if (flash_dev == NULL)
		return -1;

#if defined(PIOS_INCLUDE_FREERTOS)
	flash_dev->transaction_lock = xSemaphoreCreateMutex();
#endif	/* defined(PIOS_INCLUDE_FREERTOS) */

	*flash_id = (uintptr_t) flash_dev;

	return 0;
}
        return NULL;
    }

    flash_dev = &pios_internal_flash_devs[pios_internal_flash_num_devs++];
    flash_dev->magic = PIOS_INTERNAL_FLASH_DEV_MAGIC;

    return flash_dev;
}

#endif /* defined(PIOS_INCLUDE_FREERTOS) */

int32_t PIOS_Flash_Internal_Init(uintptr_t *flash_id, __attribute__((unused)) const struct pios_flash_internal_cfg *cfg)
{
    struct pios_internal_flash_dev *flash_dev;

    flash_dev = PIOS_Flash_Internal_alloc();
    if (flash_dev == NULL) {
        return -1;
    }

#if defined(PIOS_INCLUDE_FREERTOS)
    flash_dev->transaction_lock = xSemaphoreCreateMutex();
#endif /* defined(PIOS_INCLUDE_FREERTOS) */

    *flash_id = (uintptr_t)flash_dev;

    return 0;
}

/**********************************
 *