Add SetTmr
This commit is contained in:
@@ -254,6 +254,9 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
|
|||||||
case MENU_350EN:
|
case MENU_350EN:
|
||||||
#ifndef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
case MENU_SCREN:
|
case MENU_SCREN:
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
case MENU_SET_TMR:
|
||||||
#endif
|
#endif
|
||||||
//*pMin = 0;
|
//*pMin = 0;
|
||||||
*pMax = ARRAY_SIZE(gSubMenu_OFF_ON) - 1;
|
*pMax = ARRAY_SIZE(gSubMenu_OFF_ON) - 1;
|
||||||
@@ -895,6 +898,9 @@ void MENU_AcceptSetting(void)
|
|||||||
case MENU_SET_GUI:
|
case MENU_SET_GUI:
|
||||||
gSetting_set_gui = gSubMenuSelection;
|
gSetting_set_gui = gSubMenuSelection;
|
||||||
break;
|
break;
|
||||||
|
case MENU_SET_TMR:
|
||||||
|
gSetting_set_tmr = gSubMenuSelection;
|
||||||
|
break;
|
||||||
case MENU_TX_LOCK:
|
case MENU_TX_LOCK:
|
||||||
gTxVfo->TX_LOCK = gSubMenuSelection;
|
gTxVfo->TX_LOCK = gSubMenuSelection;
|
||||||
gRequestSaveChannel = 1;
|
gRequestSaveChannel = 1;
|
||||||
@@ -1316,6 +1322,9 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
case MENU_SET_GUI:
|
case MENU_SET_GUI:
|
||||||
gSubMenuSelection = gSetting_set_gui;
|
gSubMenuSelection = gSetting_set_gui;
|
||||||
break;
|
break;
|
||||||
|
case MENU_SET_TMR:
|
||||||
|
gSubMenuSelection = gSetting_set_tmr;
|
||||||
|
break;
|
||||||
case MENU_TX_LOCK:
|
case MENU_TX_LOCK:
|
||||||
gSubMenuSelection = gTxVfo->TX_LOCK;
|
gSubMenuSelection = gTxVfo->TX_LOCK;
|
||||||
break;
|
break;
|
||||||
|
4
main.c
4
main.c
@@ -129,9 +129,9 @@ void Main(void)
|
|||||||
gEeprom.KEY_LOCK = 0;
|
gEeprom.KEY_LOCK = 0;
|
||||||
SETTINGS_SaveSettings();
|
SETTINGS_SaveSettings();
|
||||||
#ifndef ENABLE_VOX
|
#ifndef ENABLE_VOX
|
||||||
gMenuCursor = 63; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
|
gMenuCursor = 64; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar
|
||||||
#else
|
#else
|
||||||
gMenuCursor = 65; // move to hidden section, fix me if change... !!!
|
gMenuCursor = 66; // move to hidden section, fix me if change... !!!
|
||||||
#endif
|
#endif
|
||||||
gSubMenuSelection = gSetting_F_LOCK;
|
gSubMenuSelection = gSetting_F_LOCK;
|
||||||
#endif
|
#endif
|
||||||
|
1
misc.c
1
misc.c
@@ -114,6 +114,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
|||||||
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_gui = 0;
|
||||||
|
bool gSetting_set_tmr = 0;
|
||||||
bool gSetting_set_ptt_session;
|
bool gSetting_set_ptt_session;
|
||||||
uint8_t gDebug;
|
uint8_t gDebug;
|
||||||
uint8_t gDW = 0;
|
uint8_t gDW = 0;
|
||||||
|
1
misc.h
1
misc.h
@@ -166,6 +166,7 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
|||||||
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_gui;
|
||||||
|
extern bool gSetting_set_tmr;
|
||||||
extern bool gSetting_set_ptt_session;
|
extern bool gSetting_set_ptt_session;
|
||||||
extern uint8_t gDebug;
|
extern uint8_t gDebug;
|
||||||
extern uint8_t gDW;
|
extern uint8_t gDW;
|
||||||
|
32
settings.c
32
settings.c
@@ -324,6 +324,7 @@ void SETTINGS_InitEEPROM(void)
|
|||||||
gSetting_set_tot = (((Data[6] & 0xF0) >> 4) < 4) ? ((Data[6] & 0xF0) >> 4) : 0;
|
gSetting_set_tot = (((Data[6] & 0xF0) >> 4) < 4) ? ((Data[6] & 0xF0) >> 4) : 0;
|
||||||
gSetting_set_eot = (((Data[6] & 0x0F)) < 4) ? ((Data[6] & 0x0F)) : 0;
|
gSetting_set_eot = (((Data[6] & 0x0F)) < 4) ? ((Data[6] & 0x0F)) : 0;
|
||||||
|
|
||||||
|
/*
|
||||||
int tmp = ((Data[5] & 0xF0) >> 4);
|
int tmp = ((Data[5] & 0xF0) >> 4);
|
||||||
|
|
||||||
gSetting_set_inv = (((tmp >> 0) & 0x01) < 2) ? ((tmp >> 0) & 0x01): 0;
|
gSetting_set_inv = (((tmp >> 0) & 0x01) < 2) ? ((tmp >> 0) & 0x01): 0;
|
||||||
@@ -332,6 +333,21 @@ void SETTINGS_InitEEPROM(void)
|
|||||||
gSetting_set_gui = (((tmp >> 3) & 0x01) < 2) ? ((tmp >> 3) & 0x01): 0;
|
gSetting_set_gui = (((tmp >> 3) & 0x01) < 2) ? ((tmp >> 3) & 0x01): 0;
|
||||||
gSetting_set_ctr = (((Data[5] & 0x0F)) > 00 && ((Data[5] & 0x0F)) < 16) ? ((Data[5] & 0x0F)) : 10;
|
gSetting_set_ctr = (((Data[5] & 0x0F)) > 00 && ((Data[5] & 0x0F)) < 16) ? ((Data[5] & 0x0F)) : 10;
|
||||||
|
|
||||||
|
gSetting_set_tmr = ((Data[4] & 1) < 2) ? (Data[4] & 1): 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
int tmp = (Data[5] & 0xF0) >> 4;
|
||||||
|
|
||||||
|
gSetting_set_inv = (tmp >> 0) & 0x01;
|
||||||
|
gSetting_set_lck = (tmp >> 1) & 0x01;
|
||||||
|
gSetting_set_met = (tmp >> 2) & 0x01;
|
||||||
|
gSetting_set_gui = (tmp >> 3) & 0x01;
|
||||||
|
|
||||||
|
int ctr_value = Data[5] & 0x0F;
|
||||||
|
gSetting_set_ctr = (ctr_value > 0 && ctr_value < 16) ? ctr_value : 10;
|
||||||
|
|
||||||
|
gSetting_set_tmr = Data[4] & 1;
|
||||||
|
|
||||||
// And set special session settings for actions
|
// And set special session settings for actions
|
||||||
gSetting_set_ptt_session = gSetting_set_ptt;
|
gSetting_set_ptt_session = gSetting_set_ptt;
|
||||||
gEeprom.KEY_LOCK_PTT = gSetting_set_lck;
|
gEeprom.KEY_LOCK_PTT = gSetting_set_lck;
|
||||||
@@ -700,6 +716,14 @@ void SETTINGS_SaveSettings(void)
|
|||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
memset(State, 0xFF, sizeof(State));
|
memset(State, 0xFF, sizeof(State));
|
||||||
|
|
||||||
|
/*
|
||||||
|
tmp = 0;
|
||||||
|
|
||||||
|
if(gSetting_set_tmr == 1)
|
||||||
|
tmp = tmp | (1 << 0);
|
||||||
|
|
||||||
|
State[4] = tmp;
|
||||||
|
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
|
|
||||||
if(gSetting_set_inv == 1)
|
if(gSetting_set_inv == 1)
|
||||||
@@ -710,6 +734,14 @@ void SETTINGS_SaveSettings(void)
|
|||||||
tmp = tmp | (1 << 2);
|
tmp = tmp | (1 << 2);
|
||||||
if (gSetting_set_gui == 1)
|
if (gSetting_set_gui == 1)
|
||||||
tmp = tmp | (1 << 3);
|
tmp = tmp | (1 << 3);
|
||||||
|
*/
|
||||||
|
|
||||||
|
State[4] = gSetting_set_tmr ? (1 << 0) : 0;
|
||||||
|
|
||||||
|
tmp = (gSetting_set_inv << 0) |
|
||||||
|
(gSetting_set_lck << 1) |
|
||||||
|
(gSetting_set_met << 2) |
|
||||||
|
(gSetting_set_gui << 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));
|
||||||
|
@@ -146,6 +146,7 @@ const t_menu_item MenuList[] =
|
|||||||
{"SetLck", MENU_SET_LCK },
|
{"SetLck", MENU_SET_LCK },
|
||||||
{"SetMet", MENU_SET_MET },
|
{"SetMet", MENU_SET_MET },
|
||||||
{"SetGui", MENU_SET_GUI },
|
{"SetGui", MENU_SET_GUI },
|
||||||
|
{"SetTmr", MENU_SET_TMR },
|
||||||
#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
|
||||||
@@ -737,6 +738,9 @@ void UI_DisplayMenu(void)
|
|||||||
case MENU_350EN:
|
case MENU_350EN:
|
||||||
#ifndef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
case MENU_SCREN:
|
case MENU_SCREN:
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
case MENU_SET_TMR:
|
||||||
#endif
|
#endif
|
||||||
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
|
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
|
||||||
break;
|
break;
|
||||||
|
@@ -135,6 +135,7 @@ enum
|
|||||||
MENU_SET_LCK,
|
MENU_SET_LCK,
|
||||||
MENU_SET_MET,
|
MENU_SET_MET,
|
||||||
MENU_SET_GUI,
|
MENU_SET_GUI,
|
||||||
|
MENU_SET_TMR,
|
||||||
#endif
|
#endif
|
||||||
MENU_BATCAL, // battery voltage calibration
|
MENU_BATCAL, // battery voltage calibration
|
||||||
MENU_F1SHRT,
|
MENU_F1SHRT,
|
||||||
|
@@ -143,11 +143,11 @@ void UI_DisplayStatus()
|
|||||||
|
|
||||||
if(!SCANNER_IsScanning()) {
|
if(!SCANNER_IsScanning()) {
|
||||||
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
|
#ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER
|
||||||
if(gCurrentFunction == FUNCTION_TRANSMIT)
|
if(gCurrentFunction == FUNCTION_TRANSMIT && gSetting_set_tmr == true)
|
||||||
{
|
{
|
||||||
convertTime(line, 0);
|
convertTime(line, 0);
|
||||||
}
|
}
|
||||||
else if(FUNCTION_IsRx())
|
else if(FUNCTION_IsRx() && gSetting_set_tmr == true)
|
||||||
{
|
{
|
||||||
convertTime(line, 1);
|
convertTime(line, 1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user