New design Dual Watch

This commit is contained in:
Armel FAUVEAU
2024-02-17 19:05:06 +01:00
parent 682b99968a
commit 308affa672
7 changed files with 26 additions and 20 deletions

View File

@@ -393,6 +393,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
*pMax = ARRAY_SIZE(gSubMenu_SET_LCK) - 1; *pMax = ARRAY_SIZE(gSubMenu_SET_LCK) - 1;
break; break;
case MENU_SET_MET: case MENU_SET_MET:
case MENU_SET_GUI:
*pMin = 0; *pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SET_MET) - 1; *pMax = ARRAY_SIZE(gSubMenu_SET_MET) - 1;
break; break;
@@ -866,6 +867,9 @@ void MENU_AcceptSetting(void)
case MENU_SET_MET: case MENU_SET_MET:
gSetting_set_met = gSubMenuSelection; gSetting_set_met = gSubMenuSelection;
break; break;
case MENU_SET_GUI:
gSetting_set_gui = gSubMenuSelection;
break;
#endif #endif
} }
@@ -1258,6 +1262,9 @@ void MENU_ShowCurrentSetting(void)
case MENU_SET_MET: case MENU_SET_MET:
gSubMenuSelection = gSetting_set_met; gSubMenuSelection = gSetting_set_met;
break; break;
case MENU_SET_GUI:
gSubMenuSelection = gSetting_set_gui;
break;
#endif #endif
default: default:

1
misc.c
View File

@@ -113,6 +113,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
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_met = 0;
bool gSetting_set_gui = 0;
bool gSetting_set_ptt_session; bool gSetting_set_ptt_session;
#endif #endif

1
misc.h
View File

@@ -165,6 +165,7 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
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_met;
extern bool gSetting_set_gui;
extern bool gSetting_set_ptt_session; extern bool gSetting_set_ptt_session;
#endif #endif

View File

@@ -298,6 +298,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_met = (((tmp >> 2) & 0x01) < 2) ? ((tmp >> 2) & 0x01): 0;
gSetting_set_gui = (((tmp >> 3) & 0x01) < 2) ? ((tmp >> 3) & 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
@@ -630,19 +631,14 @@ void SETTINGS_SaveSettings(void)
int tmp = 0; int tmp = 0;
/*
if (c == 1)
tmp = tmp | (1 << 0);
if (d == 1)
tmp = tmp
*/
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) if (gSetting_set_met == 1)
tmp = tmp | (2 << 1); tmp = tmp | (1 << 2);
if (gSetting_set_gui == 1)
tmp = tmp | (1 << 3);
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));

View File

@@ -371,14 +371,14 @@ void DisplayRSSIBar(const bool now)
#endif #endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
sprintf(str, "%3d", -rssi_dBm); sprintf(str, "%3d", -rssi_dBm);
UI_PrintStringSmallNormal(str, LCD_WIDTH + 8, 0, line - 1); UI_PrintStringSmallNormal(str, LCD_WIDTH + 8, 0, line - 1);
} }
else else
{ {
sprintf(str, "%04d %s", -rssi_dBm, "dBm"); sprintf(str, "% 4d %s", -rssi_dBm, "dBm");
GUI_DisplaySmallest(str, 2, 25, false, true); GUI_DisplaySmallest(str, 2, 25, false, true);
} }
@@ -1008,7 +1008,7 @@ void UI_DisplayMain(void)
} }
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1); UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1);
} }
@@ -1024,7 +1024,7 @@ void UI_DisplayMain(void)
{ // show the TX power { // show the TX power
int i = vfoInfo->OUTPUT_POWER % 3; int i = vfoInfo->OUTPUT_POWER % 3;
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
const char pwr_list[][2] = {"L","M","H"}; const char pwr_list[][2] = {"L","M","H"};
UI_PrintStringSmallNormal(pwr_list[i], LCD_WIDTH + 46, 0, line + 1); UI_PrintStringSmallNormal(pwr_list[i], LCD_WIDTH + 46, 0, line + 1);
@@ -1045,7 +1045,7 @@ void UI_DisplayMain(void)
const char dir_list[][2] = {"", "+", "-"}; const char dir_list[][2] = {"", "+", "-"};
int i = vfoInfo->TX_OFFSET_FREQUENCY_DIRECTION % 3; int i = vfoInfo->TX_OFFSET_FREQUENCY_DIRECTION % 3;
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 54, 0, line + 1); UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 54, 0, line + 1);
} }
@@ -1062,7 +1062,7 @@ void UI_DisplayMain(void)
if (vfoInfo->FrequencyReverse) if (vfoInfo->FrequencyReverse)
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
{ {
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
UI_PrintStringSmallNormal("R", LCD_WIDTH + 62, 0, line + 1); UI_PrintStringSmallNormal("R", LCD_WIDTH + 62, 0, line + 1);
} }
@@ -1076,7 +1076,7 @@ void UI_DisplayMain(void)
#endif #endif
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
if (vfoInfo->CHANNEL_BANDWIDTH == BANDWIDTH_NARROW) if (vfoInfo->CHANNEL_BANDWIDTH == BANDWIDTH_NARROW)
UI_PrintStringSmallNormal("N", LCD_WIDTH + 70, 0, line + 1); UI_PrintStringSmallNormal("N", LCD_WIDTH + 70, 0, line + 1);
@@ -1111,7 +1111,7 @@ void UI_DisplayMain(void)
sprintf(String, "%s", "MONIT"); sprintf(String, "%s", "MONIT");
} }
if (isMainOnly()) if (isMainOnly() || gSetting_set_gui)
{ {
if(!gMonitor) if(!gMonitor)
{ {

View File

@@ -134,6 +134,7 @@ const t_menu_item MenuList[] =
{"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 }, {"SetMet", VOICE_ID_INVALID, MENU_SET_MET },
{"SetGui", VOICE_ID_INVALID, MENU_SET_GUI },
#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
@@ -919,9 +920,6 @@ void UI_DisplayMenu(void)
break; break;
case MENU_SET_TOT: case MENU_SET_TOT:
strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]);
break;
case MENU_SET_EOT: case MENU_SET_EOT:
strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]); // Same as SET_TOT strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]); // Same as SET_TOT
break; break;
@@ -942,8 +940,10 @@ void UI_DisplayMenu(void)
break; break;
case MENU_SET_MET: case MENU_SET_MET:
strcpy(String, gSubMenu_SET_MET[gSubMenuSelection]); case MENU_SET_GUI:
strcpy(String, gSubMenu_SET_MET[gSubMenuSelection]); // Same as SET_MET
break; break;
#endif #endif
} }

View File

@@ -130,6 +130,7 @@ enum
MENU_SET_INV, MENU_SET_INV,
MENU_SET_LCK, MENU_SET_LCK,
MENU_SET_MET, MENU_SET_MET,
MENU_SET_GUI,
#endif #endif
MENU_BATCAL, // battery voltage calibration MENU_BATCAL, // battery voltage calibration
MENU_F1SHRT, MENU_F1SHRT,