Add Switch BackLight action
This commit is contained in:
2
Makefile
2
Makefile
@@ -38,7 +38,7 @@ ENABLE_COPY_CHAN_TO_VFO ?= 1
|
|||||||
ENABLE_SPECTRUM ?= 1
|
ENABLE_SPECTRUM ?= 1
|
||||||
ENABLE_REDUCE_LOW_MID_TX_POWER?= 0
|
ENABLE_REDUCE_LOW_MID_TX_POWER?= 0
|
||||||
ENABLE_BYP_RAW_DEMODULATORS ?= 0
|
ENABLE_BYP_RAW_DEMODULATORS ?= 0
|
||||||
ENABLE_BLMIN_TMP_OFF ?= 1
|
ENABLE_BLMIN_TMP_OFF ?= 0
|
||||||
ENABLE_SCAN_RANGES ?= 1
|
ENABLE_SCAN_RANGES ?= 1
|
||||||
ENABLE_FEAT_F4HWN ?= 1
|
ENABLE_FEAT_F4HWN ?= 1
|
||||||
|
|
||||||
|
15
app/action.c
15
app/action.c
@@ -105,6 +105,7 @@ void (*action_opt_table[])(void) = {
|
|||||||
[ACTION_OPT_RXMODE] = &ACTION_RxMode,
|
[ACTION_OPT_RXMODE] = &ACTION_RxMode,
|
||||||
[ACTION_OPT_PTT] = &ACTION_Ptt,
|
[ACTION_OPT_PTT] = &ACTION_Ptt,
|
||||||
[ACTION_OPT_WN] = &ACTION_Wn,
|
[ACTION_OPT_WN] = &ACTION_Wn,
|
||||||
|
[ACTION_OPT_BACKLIGHT] = &ACTION_BackLight,
|
||||||
#else
|
#else
|
||||||
[ACTION_OPT_RXMODE] = &FUNCTION_NOP,
|
[ACTION_OPT_RXMODE] = &FUNCTION_NOP,
|
||||||
#endif
|
#endif
|
||||||
@@ -487,4 +488,18 @@ void ACTION_Wn(void)
|
|||||||
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, false);
|
BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ACTION_BackLight(void)
|
||||||
|
{
|
||||||
|
gBackLight = true;
|
||||||
|
if(gBacklightBrightnessOld == gEeprom.BACKLIGHT_MAX)
|
||||||
|
{
|
||||||
|
gEeprom.BACKLIGHT_TIME = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gEeprom.BACKLIGHT_TIME = 7;
|
||||||
|
}
|
||||||
|
BACKLIGHT_TurnOn();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
@@ -39,6 +39,7 @@ void ACTION_SwitchDemodul(void);
|
|||||||
void ACTION_RxMode(void);
|
void ACTION_RxMode(void);
|
||||||
void ACTION_Ptt(void);
|
void ACTION_Ptt(void);
|
||||||
void ACTION_Wn(void);
|
void ACTION_Wn(void);
|
||||||
|
void ACTION_BackLight(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||||
|
@@ -559,6 +559,9 @@ void MENU_AcceptSetting(void)
|
|||||||
|
|
||||||
case MENU_ABR:
|
case MENU_ABR:
|
||||||
gEeprom.BACKLIGHT_TIME = gSubMenuSelection;
|
gEeprom.BACKLIGHT_TIME = gSubMenuSelection;
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
gBackLight = false;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ABR_MIN:
|
case MENU_ABR_MIN:
|
||||||
|
16
bitmaps.c
16
bitmaps.c
@@ -58,12 +58,20 @@ const uint8_t gFontScanAll[10] =
|
|||||||
0b00111110
|
0b00111110
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
const uint8_t gFontLight[11] =
|
||||||
const uint8_t gFontF[1][7] =
|
|
||||||
{
|
{
|
||||||
{0x7f, 0x7f, 0x41, 0x75, 0x75, 0x7f, 0x7f},
|
0b00000000,
|
||||||
|
0b00011100,
|
||||||
|
0b00100010,
|
||||||
|
0b01000001,
|
||||||
|
0b01001101,
|
||||||
|
0b01110001,
|
||||||
|
0b01001101,
|
||||||
|
0b01000001,
|
||||||
|
0b00100010,
|
||||||
|
0b00011100,
|
||||||
|
0b00000000,
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
const uint8_t gFontXB[2][6] =
|
const uint8_t gFontXB[2][6] =
|
||||||
{ // "XB"
|
{ // "XB"
|
||||||
|
@@ -12,9 +12,8 @@ extern const uint8_t gFontPttClassic[2][6];
|
|||||||
extern const uint8_t gFontFM[2][6];
|
extern const uint8_t gFontFM[2][6];
|
||||||
extern const uint8_t gFontKeyLock[1][8];
|
extern const uint8_t gFontKeyLock[1][8];
|
||||||
extern const uint8_t gFontScanAll[10];
|
extern const uint8_t gFontScanAll[10];
|
||||||
/*
|
extern const uint8_t gFontLight[11];
|
||||||
extern const uint8_t gFontF[1][7];
|
|
||||||
*/
|
|
||||||
extern const uint8_t gFontXB[2][6];
|
extern const uint8_t gFontXB[2][6];
|
||||||
extern const uint8_t gFontMO[2][6];
|
extern const uint8_t gFontMO[2][6];
|
||||||
extern const uint8_t gFontDWR[3][6];
|
extern const uint8_t gFontDWR[3][6];
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
#include "driver/system.h"
|
#include "driver/system.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
|
uint8_t gBacklightBrightnessOld = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// this is decremented once every 500ms
|
// this is decremented once every 500ms
|
||||||
@@ -59,6 +60,10 @@ void BACKLIGHT_InitHardware()
|
|||||||
|
|
||||||
void BACKLIGHT_TurnOn(void)
|
void BACKLIGHT_TurnOn(void)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
gBacklightBrightnessOld = BACKLIGHT_GetBrightness();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (gEeprom.BACKLIGHT_TIME == 0) {
|
if (gEeprom.BACKLIGHT_TIME == 0) {
|
||||||
BACKLIGHT_TurnOff();
|
BACKLIGHT_TurnOff();
|
||||||
return;
|
return;
|
||||||
|
@@ -38,4 +38,8 @@ bool BACKLIGHT_IsOn();
|
|||||||
void BACKLIGHT_SetBrightness(uint8_t brigtness);
|
void BACKLIGHT_SetBrightness(uint8_t brigtness);
|
||||||
uint8_t BACKLIGHT_GetBrightness(void);
|
uint8_t BACKLIGHT_GetBrightness(void);
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
extern uint8_t gBacklightBrightnessOld;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
2
misc.c
2
misc.c
@@ -276,7 +276,7 @@ uint8_t gIsLocked = 0xFF;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
bool gPttOnePush = true;
|
bool gBackLight = false;
|
||||||
uint8_t gPttOnePushCounter = 0;
|
uint8_t gPttOnePushCounter = 0;
|
||||||
uint32_t gBlinkCounter = 0;
|
uint32_t gBlinkCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
|
1
misc.h
1
misc.h
@@ -343,6 +343,7 @@ extern uint8_t gIsLocked;
|
|||||||
extern volatile uint8_t boot_counter_10ms;
|
extern volatile uint8_t boot_counter_10ms;
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
extern bool gBackLight;
|
||||||
extern uint8_t gPttOnePushCounter;
|
extern uint8_t gPttOnePushCounter;
|
||||||
extern uint32_t gBlinkCounter;
|
extern uint32_t gBlinkCounter;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -99,6 +99,7 @@ enum ACTION_OPT_t {
|
|||||||
ACTION_OPT_RXMODE,
|
ACTION_OPT_RXMODE,
|
||||||
ACTION_OPT_PTT,
|
ACTION_OPT_PTT,
|
||||||
ACTION_OPT_WN,
|
ACTION_OPT_WN,
|
||||||
|
ACTION_OPT_BACKLIGHT,
|
||||||
#endif
|
#endif
|
||||||
ACTION_OPT_LEN
|
ACTION_OPT_LEN
|
||||||
};
|
};
|
||||||
|
@@ -424,6 +424,7 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
|
|||||||
{"SWITCH\nRX MODE", ACTION_OPT_RXMODE},
|
{"SWITCH\nRX MODE", ACTION_OPT_RXMODE},
|
||||||
{"SWITCH\nPTT", ACTION_OPT_PTT},
|
{"SWITCH\nPTT", ACTION_OPT_PTT},
|
||||||
{"SWITCH\nWIDE\nNARROW", ACTION_OPT_WN},
|
{"SWITCH\nWIDE\nNARROW", ACTION_OPT_WN},
|
||||||
|
{"SWITCH\nBACKLIGHT", ACTION_OPT_BACKLIGHT},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
11
ui/status.c
11
ui/status.c
@@ -160,11 +160,6 @@ void UI_DisplayStatus()
|
|||||||
x1 = x;
|
x1 = x;
|
||||||
}
|
}
|
||||||
else if (gWasFKeyPressed) {
|
else if (gWasFKeyPressed) {
|
||||||
/*
|
|
||||||
memcpy(line + x, gFontF, sizeof(gFontF));
|
|
||||||
x += sizeof(gFontF);
|
|
||||||
*/
|
|
||||||
|
|
||||||
UI_PrintStringSmallBufferNormal("F", line + x + 1);
|
UI_PrintStringSmallBufferNormal("F", line + x + 1);
|
||||||
x += sizeof(gFontKeyLock);
|
x += sizeof(gFontKeyLock);
|
||||||
|
|
||||||
@@ -174,6 +169,12 @@ void UI_DisplayStatus()
|
|||||||
}
|
}
|
||||||
x1 = x;
|
x1 = x;
|
||||||
}
|
}
|
||||||
|
else if(gBackLight)
|
||||||
|
{
|
||||||
|
memcpy(line + x + 1, gFontLight, sizeof(gFontLight));
|
||||||
|
x += sizeof(gFontLight);
|
||||||
|
x1 = x;
|
||||||
|
}
|
||||||
|
|
||||||
{ // battery voltage or percentage
|
{ // battery voltage or percentage
|
||||||
char s[8] = "";
|
char s[8] = "";
|
||||||
|
Reference in New Issue
Block a user