Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2020-06-18 11:14:07 +02:00
121 changed files with 3269 additions and 1775 deletions
+22 -28
View File
@@ -29,26 +29,26 @@
#define TAB "\037\033"
#if defined(FRSKY_RELEASE)
#define DISPLAY_VERSION "FrSky"
#define DISPLAY_VERSION "-frsky"
#elif defined(JUMPER_RELEASE)
#define DISPLAY_VERSION "JumperRC"
#define DISPLAY_VERSION "-jumper"
#elif defined(RADIOMASTER_RELEASE)
#define DISPLAY_VERSION "Radiomaster"
#define DISPLAY_VERSION "-radiomaster"
#elif defined(TBS_RELEASE)
#define DISPLAY_VERSION "TBS"
#define DISPLAY_VERSION "-tbs"
#else
#define DISPLAY_VERSION VERSION
#define DISPLAY_VERSION
#endif
#if defined(COLORLCD)
const char vers_stamp[] = "opentx-" FLAVOUR "-" DISPLAY_VERSION " (" GIT_STR ")";
const char date_stamp[] = DATE;
const char time_stamp[] = TIME;
const char eeprom_stamp[] = EEPROM_STR;
const char vers_stamp[] = "VERS" TAB ": " VERSION DISPLAY_VERSION " (" GIT_STR ")";
const char date_stamp[] = "DATE" TAB ": " DATE;
const char time_stamp[] = "TIME" TAB ": " TIME;
const char eeprom_stamp[] = "EEPR" TAB ": " EEPROM_STR;
#elif defined(BOARD_NAME)
const char vers_stamp[] = "FW" TAB ": opentx-" BOARD_NAME "\036VERS" TAB ": " DISPLAY_VERSION " (" GIT_STR ")" "\036DATE" TAB ": " DATE " " TIME "\036EEPR" TAB ": " EEPROM_STR;
const char vers_stamp[] = "FW" TAB ": opentx-" BOARD_NAME "\036VERS" TAB ": " VERSION DISPLAY_VERSION " (" GIT_STR ")" "\036DATE" TAB ": " DATE " " TIME "\036EEPR" TAB ": " EEPROM_STR;
#else
const char vers_stamp[] = "FW" TAB ": opentx-" FLAVOUR "\036VERS" TAB ": " DISPLAY_VERSION " (" GIT_STR ")" "\036DATE" TAB ": " DATE " " TIME "\036EEPR" TAB ": " EEPROM_STR;
const char vers_stamp[] = "FW" TAB ": opentx-" FLAVOUR "\036VERS" TAB ": " VERSION DISPLAY_VERSION " (" GIT_STR ")" "\036DATE" TAB ": " DATE " " TIME "\036EEPR" TAB ": " EEPROM_STR;
#endif
/**
@@ -56,35 +56,29 @@
* @return
*/
#if defined(STM32) && !defined(SIMU)
__SECTION_USED(".fwversiondata") const char firmware_version[] = "opentx-" FLAVOUR "-" DISPLAY_VERSION " (" GIT_STR ")";
__SECTION_USED(".bootversiondata") const char boot_version[] = "opentx-" FLAVOUR "-" DISPLAY_VERSION " (" GIT_STR ")";
__SECTION_USED(".fwversiondata") const char firmware_version[] = "opentx-" FLAVOUR "-" VERSION DISPLAY_VERSION " (" GIT_STR ")";
__SECTION_USED(".bootversiondata") const char boot_version[] = "opentx-" FLAVOUR "-" VERSION DISPLAY_VERSION " (" GIT_STR ")";
/**
* Tries to find opentx version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer
* @param buffer If non-null find the firmware version in the buffer instead
*/
const char * getOtherVersion(char* buffer)
const char * getFirmwareVersion(const char * buffer)
{
if (buffer == nullptr) {
#if defined(BOOT)
const char * startother = (char*)(FIRMWARE_ADDRESS+BOOTLOADER_SIZE);
buffer = (const char *)(FIRMWARE_ADDRESS + BOOTLOADER_SIZE);
#else
const char * startother = (char*)(FIRMWARE_ADDRESS);
buffer = (const char *)FIRMWARE_ADDRESS;
#endif
if (buffer != nullptr)
startother = buffer;
}
const char * other_str = nullptr;
for (int i=0; i<1024;i++) {
if (memcmp(startother+i, "opentx-", 7) == 0) {
other_str = startother + i;
break;
for (int i = 0; i < 1024; i++) {
if (memcmp(buffer + i, "opentx-", 7) == 0) {
return buffer + i;
}
}
if (other_str != nullptr)
return other_str;
else
return "no version found";
return "no version found";
}
#endif