kopia lustrzana https://github.com/OpenRTX/OpenRTX
Print git commit or tag inside Info menu
rodzic
93d2ede113
commit
58f4f5dcaf
|
@ -69,6 +69,14 @@ src = openrtx_src + minmea_src
|
|||
inc = openrtx_inc + rtos_inc + minmea_inc + qdec_inc
|
||||
def = {'DONT_USE_CMSIS_INIT': ''}
|
||||
|
||||
## Add git commit or tag to print in OpenRTX
|
||||
r = run_command('git', 'describe', '--tags', '--dirty')
|
||||
if r.returncode() != 0
|
||||
# it failed
|
||||
endif
|
||||
git_version = '"'+r.stdout().strip()+'"'
|
||||
def = def + {'GIT_VERSION': git_version}
|
||||
|
||||
##
|
||||
## --------------------- Family-dependent source files -------------------------
|
||||
##
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <hwconfig.h>
|
||||
|
||||
// Maximum menu entry length
|
||||
#define MAX_ENTRY_LEN 16
|
||||
#define MAX_ENTRY_LEN 21
|
||||
// Frequency digits
|
||||
#define FREQ_DIGITS 8
|
||||
// Time & Date digits
|
||||
|
|
|
@ -148,6 +148,7 @@ const char *settings_gps_items[] =
|
|||
|
||||
const char *info_items[] =
|
||||
{
|
||||
"",
|
||||
"Bat. Voltage",
|
||||
"Bat. Charge",
|
||||
"RSSI",
|
||||
|
|
|
@ -184,28 +184,31 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index)
|
|||
if(index >= info_num) return -1;
|
||||
switch(index)
|
||||
{
|
||||
case 0: // Battery voltage
|
||||
case 0: // Git Version
|
||||
snprintf(buf, max_len, "%s", GIT_VERSION);
|
||||
break;
|
||||
case 1: // Battery voltage
|
||||
snprintf(buf, max_len, "%.1fV", last_state.v_bat);
|
||||
break;
|
||||
case 1: // Battery charge
|
||||
case 2: // Battery charge
|
||||
snprintf(buf, max_len, "%.1f%%", last_state.charge * 100);
|
||||
break;
|
||||
case 2: // RSSI
|
||||
case 3: // RSSI
|
||||
snprintf(buf, max_len, "%.1fdBm", last_state.rssi);
|
||||
break;
|
||||
case 3: // Model
|
||||
case 4: // Model
|
||||
snprintf(buf, max_len, "%s", hwinfo->name);
|
||||
break;
|
||||
case 4: // Band
|
||||
case 5: // Band
|
||||
snprintf(buf, max_len, "%s %s", hwinfo->vhf_band ? "VHF" : "", hwinfo->uhf_band ? "UHF" : "");
|
||||
break;
|
||||
case 5: // VHF
|
||||
case 6: // VHF
|
||||
snprintf(buf, max_len, "%d - %d", hwinfo->vhf_minFreq, hwinfo->vhf_maxFreq);
|
||||
break;
|
||||
case 6: // UHF
|
||||
case 7: // UHF
|
||||
snprintf(buf, max_len, "%d - %d", hwinfo->uhf_minFreq, hwinfo->uhf_maxFreq);
|
||||
break;
|
||||
case 7: // LCD Type
|
||||
case 8: // LCD Type
|
||||
snprintf(buf, max_len, "%d", hwinfo->lcd_type);
|
||||
break;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue