Implement reading firmware on Horus via USB (#5442)

* Add firmware lun target for non EEPROM platforms

* Fix Fat fat tables and make FAT 1024 byte big

* Niceify some constants

* Cleanup (saves 1024 byte of flash) and fix reporting wrong Size of drive

* Silence compiler warning, set right size for flash on X12/X10

* Add firmware.txt/bootload.txt to virtual drive that displays version information

* Report also version of other component (bootloader/firmware)

* Show version also in bootloader and fix F4 platforms

* Save space on X7

* Fix X7 logic

* Compile fix for AVR

* avr-gcc does not like no newline after ifdef

* Really fix avr
This commit is contained in:
Arne Schwabe
2017-12-18 23:19:19 +01:00
committed by Bertrand Songis
parent d13e770ac4
commit 975759284d
10 changed files with 250 additions and 356 deletions
@@ -32,6 +32,7 @@ set(BOOTLOADER_SRC
../../../gui/${GUI_DIR}/fonts.cpp
../../../keys.cpp
../../../strhelpers.cpp
../../../stamp.cpp
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_core.c
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd.c
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd_int.c
@@ -398,6 +398,18 @@ int main()
lcdDrawTextAlignedLeft(2*FH, "\010Write Firmware");
lcdDrawTextAlignedLeft(3*FH, "\010Restore EEPROM");
lcdDrawTextAlignedLeft(4*FH, "\010Exit");
#if LCD_W >= 212
lcdDrawTextAlignedLeft(6*FH, "\001Curr FW:");
lcdDrawText(50, 6*FH, getOtherVersion());
#else
lcdDrawTextAlignedLeft(6*FH, "\001FW:");
// Remove opentx- from string
const char* other_ver = getOtherVersion();
if (strstr(other_ver, "opentx-"))
other_ver = other_ver+7;
lcdDrawText(20, 6*FH, other_ver);
#endif
lcdInvertLine(2+vpos);
lcdDrawTextAlignedLeft(7*FH, STR_OR_PLUGIN_USB_CABLE);
if (event == EVT_KEY_FIRST(BOOT_KEY_DOWN)) {