5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
25 #define DEFNUMSTR(s) STR2(s)
28 #define EEPROM_STR DEFNUMSTR(EEPROM_VER) "-" DEFNUMSTR(EEPROM_VARIANT)
30 #define EEPROM_STR DEFNUMSTR(EEPROM_VER);
34 #define TAB "\037\075"
38 const pm_char vers_stamp
[] PROGMEM
= "VERS" TAB
": " "opentx-" FLAVOUR
"-" VERSION
" (" GIT_STR
")";
39 const pm_char date_stamp
[] PROGMEM
= "DATE" TAB
": " DATE
;
40 const pm_char time_stamp
[] PROGMEM
= "TIME" TAB
": " TIME
;
41 const pm_char eeprom_stamp
[] PROGMEM
= "EEPR" TAB
": " EEPROM_STR
;
42 #elif defined(PCBTARANIS)
43 const pm_char vers_stamp
[] PROGMEM
= "FW\037\033: " "opentx-" FLAVOUR
"\036VERS\037\033: " VERSION
" (" GIT_STR
")" "\036DATE\037\033: " DATE
" " TIME
"\036EEPR\037\033: " EEPROM_STR
;
45 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
;
49 * Retrieves the version of the bootloader or firmware
54 __SECTION_USED(".fwversiondata") const char firmware_version
[] = "opentx-" FLAVOUR
"-" VERSION
" (" GIT_STR
")";
55 __SECTION_USED(".bootversiondata") const char boot_version
[] = "opentx-" FLAVOUR
"-" VERSION
" (" GIT_STR
")";
58 * Tries to find opentx version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer
59 * @param buffer If non-null find the firmware version in the buffer instead
61 const char* getOtherVersion(char* buffer
)
64 const char* startother
= (char*)(FIRMWARE_ADDRESS
+BOOTLOADER_SIZE
);
66 const char* startother
= (char*)(FIRMWARE_ADDRESS
);
68 if (buffer
!= nullptr)
71 const char* other_str
= nullptr;
72 for (int i
=0; i
< 1024;i
++) {
73 if (memcmp(startother
+i
, "opentx-", 7)==0) {
74 other_str
= startother
+ i
;
78 if (other_str
!= nullptr)
81 return "no version found";