/* Find the main storage container */
status = ux_host_stack_class_get(_ux_system_host_class_storage_name, &class);
if (status != UX_SUCCESS)
return(status);
/* We get the first instance of the storage device */
do
{
status = ux_host_stack_class_instance_get(class, 0, (void **) &storage);
tx_thread_sleep(10);
} while (status != UX_SUCCESS);
/* We still need to wait for the storage status to be live */
while (storage -> ux_host_class_storage_state != UX_HOST_CLASS_INSTANCE_LIVE)
tx_thread_sleep(10);
/* We try to get the first media attached to the class container. */
while (class -> ux_host_class_media == UX_NULL)
{
tx_thread_sleep(10);
}
/* Setup media pointer. */
storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class -> ux_host_class_media;
media = &storage_media -> ux_host_class_storage_media;