The attached XML file can replace the one in your module's .module_descriptions folder. It will add the external reference to the media pointer. As there is no callback registered to provide status information when a USB mass storage device has been plugged in and is ready this needs to be done manually with the code below. As Gary has said this will be fixed in the production release. Ian. FX_MEDIA g_fx_media0; UX_HOST_CLASS * class_driver; UX_HOST_CLASS_STORAGE * storage; UX_HOST_CLASS_STORAGE_MEDIA * storage_media; FX_MEDIA * media; /* Find the main storage container */ status = ux_host_stack_class_get(_ux_system_host_class_storage_name, &class); if (status != UX_SUCCESS) { while(1); } /* We get the first instance of the storage device */ do { status = ux_host_stack_class_instance_get(class, 0, (void **) &storage); tx_thread_relinquish(); } 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_relinquish(); } /* We try to get the first media attached to the class container */ storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class- ux_host_class_media; while (storage_media- ux_host_class_storage_media_status != UX_HOST_CLASS_STORAGE_MEDIA_MOUNTED) { tx_thread_relinquish(); } media = &storage_media- ux_host_class_storage_media; /* Copy contents of FX_MEDIA to instance passed previously to HTTP server create API */ memcpy(&g_fx_media0, media, sizeof(FX_MEDIA)); /* The HTTP/FTP etc server(s) can now be started. */ (Please visit the site to view this file)
↧