opentx/opentx — pull request #1298 by ChrisNisbet01 (2014-06-17 03:24:47+00:00)
Title: CN - Adds support for a mass storage USB device in the main firmware.

Please consider this pull request for inclusion in the main project. It allows the user to compile firmware that does not include the USB joystick device, and provides a mass storage device giving access to the SD card instead. I have little use for a joystick, but frequently need to access the SD card. This change allows me to build firmware that provides me easy access to the SD card, without needing to go into the bootloader. The device also restarts after the USB cable is unplugged (as it used to pre-V2.0), which also saves me time. It basically reinstates the mass storage support that was removed in favour of the joystick device.
I suspect that other people would also be interested in this change, which is why I'm submitting it for inclusion in the main project.
By default, the firmware still includes the USB joystick device, but it is possible to replace this code with a mass storage device that allows access to the SD card when running the main firmware.
Note that behaviour is similar to what existed pre-V2.0. i.e. the transmitter will restart when the USB cable is unplugged, and the main menu is displayed when the usb cable is plugged in.
To include the mass storage device and remove the joystick device, add "USB=MASS" (actually, anything but JOYSTICK) to the command line args when making the firmware. If this option is not included in the command, the USB joystick is included as usual.
Note that access to the EEPROM and FLASH is _not_ available. The bootloader should be used to read/write to those storage locations.