1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 11:59:50 +03:00

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

View file

@ -44,3 +44,39 @@
#else
const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR;
#endif
/**
* Retrieves the version of the bootloader or firmware
* @return
*/
#if defined(HORUS)
const char* getOtherVersion()
{
return "no bootloader support";
}
#elif defined(STM32)
__attribute__ ((section(".fwversiondata"), used)) const char firmware_version[32] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
__attribute__ ((section(".bootversiondata"), used)) const char boot_version[32] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
const char* getOtherVersion()
{
#if defined(BOOT)
const char* startother = (char*)(FIRMWARE_ADDRESS+BOOTLOADER_SIZE);
#else
const char* startother = (char*)(FIRMWARE_ADDRESS);
#endif
const char* other_str = nullptr;
for (int i=0; i< 1024;i++) {
if (memcmp(startother+i, "opentx-", 7)==0) {
other_str = startother + i;
break;
}
}
if (other_str != nullptr)
return other_str;
else
return "no version found";
}
#endif