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

Re #3255: UID displayed on VERSION screen (Taranis)

This commit is contained in:
Damjan Adamic 2016-02-29 20:44:30 +01:00
parent 726e32731b
commit 98a7900e70
4 changed files with 19 additions and 0 deletions

View file

@ -77,10 +77,16 @@ void menuGeneralVersion(uint8_t event)
exit(0); exit(0);
#endif #endif
} }
if (event == EVT_ENTRY) {
getCPUUniqueID(reusableBuffer.version.id);
}
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1); SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1);
lcd_putsLeft(MENU_HEADER_HEIGHT+1, vers_stamp); lcd_putsLeft(MENU_HEADER_HEIGHT+1, vers_stamp);
lcd_putsLeft(MENU_HEADER_HEIGHT+4*FH+1, "UID\037\033:");
lcdDrawText(5*FW+3, MENU_HEADER_HEIGHT+4*FH+1, reusableBuffer.version.id);
lcd_putsLeft(MENU_HEADER_HEIGHT+5*FH+1, STR_EEBACKUP); lcd_putsLeft(MENU_HEADER_HEIGHT+5*FH+1, STR_EEBACKUP);
lcd_putsLeft(MENU_HEADER_HEIGHT+6*FH+1, STR_FACTORYRESET); lcd_putsLeft(MENU_HEADER_HEIGHT+6*FH+1, STR_FACTORYRESET);

View file

@ -1560,6 +1560,13 @@ union ReusableBuffer
char originalName[SD_SCREEN_FILE_LENGTH+1]; char originalName[SD_SCREEN_FILE_LENGTH+1];
} sdmanager; } sdmanager;
#endif #endif
#if defined(PCBTARANIS)
struct
{
char id[27];
} version;
#endif
}; };
extern union ReusableBuffer reusableBuffer; extern union ReusableBuffer reusableBuffer;

View file

@ -41,6 +41,8 @@
const pm_char date_stamp[] PROGMEM = "DATE" TAB ": " DATE; const pm_char date_stamp[] PROGMEM = "DATE" TAB ": " DATE;
const pm_char time_stamp[] PROGMEM = "TIME" TAB ": " TIME; const pm_char time_stamp[] PROGMEM = "TIME" TAB ": " TIME;
const pm_char eeprom_stamp[] PROGMEM = "EEPR" TAB ": " EEPROM_STR; const pm_char eeprom_stamp[] PROGMEM = "EEPR" TAB ": " EEPROM_STR;
#elif defined(PCBTARANIS)
const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE " " TIME "\036EEPR\037\033: " EEPROM_STR;
#else #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; 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 #endif

View file

@ -41,7 +41,11 @@ void watchdogInit(unsigned int duration)
void getCPUUniqueID(char * s) void getCPUUniqueID(char * s)
{ {
#if defined(SIMU)
uint32_t cpu_uid[3] = { 0x12345678, 0xAA55AA55AA, 0x87654321};
#else
uint32_t * cpu_uid = (uint32_t *)0x1FFF7A10; uint32_t * cpu_uid = (uint32_t *)0x1FFF7A10;
#endif
char * tmp = strAppendUnsigned(s, cpu_uid[0], 8, 16); char * tmp = strAppendUnsigned(s, cpu_uid[0], 8, 16);
*tmp = ' '; *tmp = ' ';
tmp = strAppendUnsigned(tmp+1, cpu_uid[1], 8, 16); tmp = strAppendUnsigned(tmp+1, cpu_uid[1], 8, 16);