Add SetMet to set meter
This commit is contained in:
10
app/menu.c
10
app/menu.c
@@ -392,6 +392,10 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
|
|||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
*pMax = ARRAY_SIZE(gSubMenu_SET_LCK) - 1;
|
*pMax = ARRAY_SIZE(gSubMenu_SET_LCK) - 1;
|
||||||
break;
|
break;
|
||||||
|
case MENU_SET_MET:
|
||||||
|
*pMin = 0;
|
||||||
|
*pMax = ARRAY_SIZE(gSubMenu_SET_MET) - 1;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -859,6 +863,9 @@ void MENU_AcceptSetting(void)
|
|||||||
case MENU_SET_LCK:
|
case MENU_SET_LCK:
|
||||||
gSetting_set_lck = gSubMenuSelection;
|
gSetting_set_lck = gSubMenuSelection;
|
||||||
break;
|
break;
|
||||||
|
case MENU_SET_MET:
|
||||||
|
gSetting_set_met = gSubMenuSelection;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1248,6 +1255,9 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
case MENU_SET_LCK:
|
case MENU_SET_LCK:
|
||||||
gSubMenuSelection = gSetting_set_lck;
|
gSubMenuSelection = gSetting_set_lck;
|
||||||
break;
|
break;
|
||||||
|
case MENU_SET_MET:
|
||||||
|
gSubMenuSelection = gSetting_set_met;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
1
misc.c
1
misc.c
@@ -103,6 +103,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
|||||||
bool gSetting_set_inv = false;
|
bool gSetting_set_inv = false;
|
||||||
uint8_t gSetting_set_eot = 0;
|
uint8_t gSetting_set_eot = 0;
|
||||||
bool gSetting_set_lck = false;
|
bool gSetting_set_lck = false;
|
||||||
|
bool gSetting_set_met = 0;
|
||||||
bool gSetting_set_ptt_session;
|
bool gSetting_set_ptt_session;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
1
misc.h
1
misc.h
@@ -164,6 +164,7 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
|||||||
extern bool gSetting_set_inv;
|
extern bool gSetting_set_inv;
|
||||||
extern uint8_t gSetting_set_eot;
|
extern uint8_t gSetting_set_eot;
|
||||||
extern bool gSetting_set_lck;
|
extern bool gSetting_set_lck;
|
||||||
|
extern bool gSetting_set_met;
|
||||||
extern bool gSetting_set_ptt_session;
|
extern bool gSetting_set_ptt_session;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -297,6 +297,7 @@ void SETTINGS_InitEEPROM(void)
|
|||||||
|
|
||||||
gSetting_set_inv = (((tmp >> 0) & 0x01) < 2) ? ((tmp >> 0) & 0x01): 0;
|
gSetting_set_inv = (((tmp >> 0) & 0x01) < 2) ? ((tmp >> 0) & 0x01): 0;
|
||||||
gSetting_set_lck = (((tmp >> 1) & 0x01) < 2) ? ((tmp >> 1) & 0x01): 0;
|
gSetting_set_lck = (((tmp >> 1) & 0x01) < 2) ? ((tmp >> 1) & 0x01): 0;
|
||||||
|
gSetting_set_met = (((tmp >> 2) & 0x01) < 2) ? ((tmp >> 2) & 0x01): 0;
|
||||||
gSetting_set_ctr = (((Data[5] & 0x0F)) < 16) ? ((Data[5] & 0x0F)) : 5;
|
gSetting_set_ctr = (((Data[5] & 0x0F)) < 16) ? ((Data[5] & 0x0F)) : 5;
|
||||||
|
|
||||||
// And set special session settings for actions
|
// And set special session settings for actions
|
||||||
@@ -637,9 +638,11 @@ void SETTINGS_SaveSettings(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if(gSetting_set_inv == 1)
|
if(gSetting_set_inv == 1)
|
||||||
tmp = tmp | (1 << 0);
|
tmp = tmp | (1 << 0);
|
||||||
if (gSetting_set_lck == 1)
|
if (gSetting_set_lck == 1)
|
||||||
tmp = tmp | (1 << 1);
|
tmp = tmp | (1 << 1);
|
||||||
|
if (gSetting_set_met == 1)
|
||||||
|
tmp = tmp | (2 << 1);
|
||||||
|
|
||||||
State[5] = ((tmp << 4) | (gSetting_set_ctr & 0x0F));
|
State[5] = ((tmp << 4) | (gSetting_set_ctr & 0x0F));
|
||||||
State[6] = ((gSetting_set_tot << 4) | (gSetting_set_eot & 0x0F));
|
State[6] = ((gSetting_set_tot << 4) | (gSetting_set_eot & 0x0F));
|
||||||
|
59
ui/main.c
59
ui/main.c
@@ -90,22 +90,7 @@ static void DrawSmallAntennaAndBars(uint8_t *p, unsigned int level)
|
|||||||
|
|
||||||
static void DrawLevelBar(uint8_t xpos, uint8_t line, uint8_t level)
|
static void DrawLevelBar(uint8_t xpos, uint8_t line, uint8_t level)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
const char hollowBar[] = {
|
|
||||||
0b00111110,
|
|
||||||
0b00100010,
|
|
||||||
0b00100010,
|
|
||||||
0b00111110
|
|
||||||
};
|
|
||||||
|
|
||||||
const char simpleBar[] = {
|
|
||||||
0b00111110,
|
|
||||||
0b00111110,
|
|
||||||
0b00111110,
|
|
||||||
0b00111110
|
|
||||||
};
|
|
||||||
|
|
||||||
#else
|
|
||||||
const char hollowBar[] = {
|
const char hollowBar[] = {
|
||||||
0b01111111,
|
0b01111111,
|
||||||
0b01000001,
|
0b01000001,
|
||||||
@@ -119,11 +104,45 @@ static void DrawLevelBar(uint8_t xpos, uint8_t line, uint8_t level)
|
|||||||
|
|
||||||
for(uint8_t i = 0; i < level; i++) {
|
for(uint8_t i = 0; i < level; i++) {
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
if(i < 9) {
|
if(gSetting_set_met)
|
||||||
memcpy(p_line + (xpos + i * 5), &simpleBar, ARRAY_SIZE(simpleBar));
|
{
|
||||||
|
const char hollowBar[] = {
|
||||||
|
0b01111111,
|
||||||
|
0b01000001,
|
||||||
|
0b01000001,
|
||||||
|
0b01111111
|
||||||
|
};
|
||||||
|
|
||||||
|
if(i < 9) {
|
||||||
|
for(uint8_t j = 0; j < 4; j++)
|
||||||
|
p_line[xpos + i * 5 + j] = (~(0x7F >> (i+1))) & 0x7F;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
{
|
||||||
|
const char hollowBar[] = {
|
||||||
|
0b00111110,
|
||||||
|
0b00100010,
|
||||||
|
0b00100010,
|
||||||
|
0b00111110
|
||||||
|
};
|
||||||
|
|
||||||
|
const char simpleBar[] = {
|
||||||
|
0b00111110,
|
||||||
|
0b00111110,
|
||||||
|
0b00111110,
|
||||||
|
0b00111110
|
||||||
|
};
|
||||||
|
|
||||||
|
if(i < 9) {
|
||||||
|
memcpy(p_line + (xpos + i * 5), &simpleBar, ARRAY_SIZE(simpleBar));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(i < 9) {
|
if(i < 9) {
|
||||||
|
11
ui/menu.c
11
ui/menu.c
@@ -133,6 +133,7 @@ const t_menu_item MenuList[] =
|
|||||||
{"SetCtr", VOICE_ID_INVALID, MENU_SET_CTR },
|
{"SetCtr", VOICE_ID_INVALID, MENU_SET_CTR },
|
||||||
{"SetInv", VOICE_ID_INVALID, MENU_SET_INV },
|
{"SetInv", VOICE_ID_INVALID, MENU_SET_INV },
|
||||||
{"SetLck", VOICE_ID_INVALID, MENU_SET_LCK },
|
{"SetLck", VOICE_ID_INVALID, MENU_SET_LCK },
|
||||||
|
{"SetMet", VOICE_ID_INVALID, MENU_SET_MET },
|
||||||
#endif
|
#endif
|
||||||
// hidden menu items from here on
|
// hidden menu items from here on
|
||||||
// enabled if pressing both the PTT and upper side button at power-on
|
// enabled if pressing both the PTT and upper side button at power-on
|
||||||
@@ -377,6 +378,12 @@ const char gSubMenu_SCRAMBLER[][7] =
|
|||||||
"KEYS",
|
"KEYS",
|
||||||
"KEYS+PTT"
|
"KEYS+PTT"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char gSubMenu_SET_MET[][8] =
|
||||||
|
{
|
||||||
|
"TINY",
|
||||||
|
"CLASSIC"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
|
const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
|
||||||
@@ -933,6 +940,10 @@ void UI_DisplayMenu(void)
|
|||||||
case MENU_SET_LCK:
|
case MENU_SET_LCK:
|
||||||
strcpy(String, gSubMenu_SET_LCK[gSubMenuSelection]);
|
strcpy(String, gSubMenu_SET_LCK[gSubMenuSelection]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_SET_MET:
|
||||||
|
strcpy(String, gSubMenu_SET_MET[gSubMenuSelection]);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -129,6 +129,7 @@ enum
|
|||||||
MENU_SET_CTR,
|
MENU_SET_CTR,
|
||||||
MENU_SET_INV,
|
MENU_SET_INV,
|
||||||
MENU_SET_LCK,
|
MENU_SET_LCK,
|
||||||
|
MENU_SET_MET,
|
||||||
#endif
|
#endif
|
||||||
MENU_BATCAL, // battery voltage calibration
|
MENU_BATCAL, // battery voltage calibration
|
||||||
MENU_F1SHRT,
|
MENU_F1SHRT,
|
||||||
@@ -167,6 +168,7 @@ extern const char gSubMenu_D_RSP[4][11];
|
|||||||
extern const char gSubMenu_SET_PTT[2][8];
|
extern const char gSubMenu_SET_PTT[2][8];
|
||||||
extern const char gSubMenu_SET_TOT[4][7];
|
extern const char gSubMenu_SET_TOT[4][7];
|
||||||
extern const char gSubMenu_SET_LCK[2][9];
|
extern const char gSubMenu_SET_LCK[2][9];
|
||||||
|
extern const char gSubMenu_SET_MET[2][8];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const char* const gSubMenu_PTT_ID[5];
|
extern const char* const gSubMenu_PTT_ID[5];
|
||||||
|
Reference in New Issue
Block a user