8
Makefile
8
Makefile
@@ -44,7 +44,7 @@ ENABLE_FEAT_F4HWN ?= 1
|
|||||||
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
|
ENABLE_FEAT_F4HWN_SCREENSHOT ?= 0
|
||||||
ENABLE_FEAT_F4HWN_SPECTRUM ?= 1
|
ENABLE_FEAT_F4HWN_SPECTRUM ?= 1
|
||||||
ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 1
|
ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 1
|
||||||
ENABLE_FEAT_F4HWN_CHARGING_C ?= 1
|
ENABLE_FEAT_F4HWN_CHARGING_C ?= 0
|
||||||
ENABLE_FEAT_F4HWN_SLEEP ?= 1
|
ENABLE_FEAT_F4HWN_SLEEP ?= 1
|
||||||
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
|
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
|
||||||
ENABLE_FEAT_F4HWN_NARROWER ?= 1
|
ENABLE_FEAT_F4HWN_NARROWER ?= 1
|
||||||
@@ -224,12 +224,14 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
|
|||||||
VERSION_STRING_1 ?= v0.22
|
VERSION_STRING_1 ?= v0.22
|
||||||
|
|
||||||
AUTHOR_STRING_2 ?= F4HWN
|
AUTHOR_STRING_2 ?= F4HWN
|
||||||
VERSION_STRING_2 ?= v3.8
|
VERSION_STRING_2 ?= v3.9
|
||||||
|
|
||||||
EDITION_STRING ?= Custom
|
EDITION_STRING ?= Custom
|
||||||
|
|
||||||
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
|
AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2)
|
||||||
VERSION_STRING ?= $(VERSION_STRING_2)
|
VERSION_STRING ?= $(VERSION_STRING_2)
|
||||||
|
|
||||||
|
SQL_TONE ?= 550 # For SA818, use 600 and python3 sa818.py --port /dev/ttyS2 radio --frequency 434.975 --ctcss 71.9 --tail Open
|
||||||
else
|
else
|
||||||
AUTHOR_STRING ?= EGZUMER
|
AUTHOR_STRING ?= EGZUMER
|
||||||
# the user might not have/want git installed
|
# the user might not have/want git installed
|
||||||
@@ -412,7 +414,7 @@ endif
|
|||||||
ifeq ($(ENABLE_FEAT_F4HWN),1)
|
ifeq ($(ENABLE_FEAT_F4HWN),1)
|
||||||
CFLAGS += -DENABLE_FEAT_F4HWN
|
CFLAGS += -DENABLE_FEAT_F4HWN
|
||||||
CFLAGS += -DALERT_TOT=10
|
CFLAGS += -DALERT_TOT=10
|
||||||
CFLAGS += -DSQL_TONE=550 # For SA818, use 600 and python3 sa818.py --port /dev/ttyS2 radio --frequency 434.975 --ctcss 71.9 --tail Open
|
CFLAGS += -DSQL_TONE=$(SQL_TONE)
|
||||||
CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
|
CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
|
||||||
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
|
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
|
||||||
CFLAGS += -DEDITION_STRING=\"$(EDITION_STRING)\"
|
CFLAGS += -DEDITION_STRING=\"$(EDITION_STRING)\"
|
||||||
|
@@ -26,7 +26,7 @@ Anyway, have fun.
|
|||||||
|
|
||||||
# Donations
|
# Donations
|
||||||
|
|
||||||
Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas (4 times), Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern, Joseph Roth, Pierre-Yves Colin, Frank DJ7FG, Marcel Testaz, Brian Frobisher, Yannick F4JFO, Paolo Bussola, Dirk DL8DF, Levente Szőke (2 times), Bernard-Michel Herrera, Jérôme Saintespes, Paul Davies, RS, Johan F4WAT, Robert Wörle, Rafael Sundorf, Paul Harker, Peter Fintl, Pascal F4ICR (2 times), Mike DL2MF, Eric KI1C (2 times) and Phil G0ELM for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
|
Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas (4 times), Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306, Thierry F4GVO, Eric F1NOU, PricelessToolkit, Ady M6NYJ, Tom McGovern, Joseph Roth, Pierre-Yves Colin, Frank DJ7FG, Marcel Testaz, Brian Frobisher, Yannick F4JFO, Paolo Bussola, Dirk DL8DF, Levente Szőke (2 times), Bernard-Michel Herrera, Jérôme Saintespes, Paul Davies, RS, Johan F4WAT, Robert Wörle, Rafael Sundorf, Paul Harker, Peter Fintl, Pascal F4ICR (2 times), Mike DL2MF, Eric KI1C (2 times), Phil G0ELM, Jérôme Lambert, Meinhard Frank Günther and Eliot Vedel for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
|
@@ -234,7 +234,14 @@ void ACTION_Scan(bool bRestart)
|
|||||||
gScheduleScanListen = false;
|
gScheduleScanListen = false;
|
||||||
} else {
|
} else {
|
||||||
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
|
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
|
||||||
|
if(gScanRangeStart == 0) // No ScanRange
|
||||||
|
{
|
||||||
gEeprom.CURRENT_STATE = 1;
|
gEeprom.CURRENT_STATE = 1;
|
||||||
|
}
|
||||||
|
else // ScanRange
|
||||||
|
{
|
||||||
|
gEeprom.CURRENT_STATE = 2;
|
||||||
|
}
|
||||||
SETTINGS_WriteCurrentState();
|
SETTINGS_WriteCurrentState();
|
||||||
#endif
|
#endif
|
||||||
// start scanning
|
// start scanning
|
||||||
|
12
app/main.c
12
app/main.c
@@ -349,6 +349,11 @@ void channelMove(uint16_t Channel)
|
|||||||
//gRequestSaveVFO = true;
|
//gRequestSaveVFO = true;
|
||||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||||
|
gRemoveOffset = false;
|
||||||
|
gPowerHigh = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
RADIO_ConfigureChannel(gEeprom.TX_VFO, gVfoConfigureMode);
|
RADIO_ConfigureChannel(gEeprom.TX_VFO, gVfoConfigureMode);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -735,6 +740,7 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
|
|||||||
if (!bKeyPressed) // released
|
if (!bKeyPressed) // released
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
|
#ifdef ENABLE_FEAT_F4HWN_RESTORE_SCAN
|
||||||
if(gScanRangeStart == 0) // No ScanRange
|
if(gScanRangeStart == 0) // No ScanRange
|
||||||
{
|
{
|
||||||
@@ -746,6 +752,7 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
|
|||||||
}
|
}
|
||||||
SETTINGS_WriteCurrentState();
|
SETTINGS_WriteCurrentState();
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
ACTION_Scan(false);// toggle scanning
|
ACTION_Scan(false);// toggle scanning
|
||||||
|
|
||||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
@@ -821,6 +828,11 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||||
|
gRemoveOffset = false;
|
||||||
|
gPowerHigh = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t Channel = gEeprom.ScreenChannel[gEeprom.TX_VFO];
|
uint8_t Channel = gEeprom.ScreenChannel[gEeprom.TX_VFO];
|
||||||
|
|
||||||
if (bKeyHeld || !bKeyPressed) { // key held or released
|
if (bKeyHeld || !bKeyPressed) { // key held or released
|
||||||
|
@@ -840,6 +840,12 @@ void MENU_AcceptSetting(void)
|
|||||||
gUnlockAllTxConfCnt = 0;
|
gUnlockAllTxConfCnt = 0;
|
||||||
|
|
||||||
gSetting_F_LOCK = gSubMenuSelection;
|
gSetting_F_LOCK = gSubMenuSelection;
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
if(gSetting_F_LOCK == F_LOCK_ALL) {
|
||||||
|
SETTINGS_ResetTxLock();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
|
@@ -952,12 +952,23 @@ static void ShowChannelName(uint32_t f)
|
|||||||
if (SETTINGS_FetchChannelFrequency(i) == f)
|
if (SETTINGS_FetchChannelFrequency(i) == f)
|
||||||
{
|
{
|
||||||
SETTINGS_FetchChannelName(String, i);
|
SETTINGS_FetchChannelName(String, i);
|
||||||
UI_PrintStringSmallBold(String[0] ? String : "--", 8, 127, 1);
|
if (String[0] != 0) {
|
||||||
|
UI_PrintStringSmallBufferNormal(String, gStatusLine + 36);
|
||||||
|
//GUI_DisplaySmallest(String, 127, 1, true, true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 36; i < 100; i++)
|
||||||
|
{
|
||||||
|
gStatusLine[i] = 0b00000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ST7565_BlitStatusLine();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1281,6 +1292,9 @@ static void RenderStatus()
|
|||||||
{
|
{
|
||||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||||
DrawStatus();
|
DrawStatus();
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||||
|
ShowChannelName(peak.f);
|
||||||
|
#endif
|
||||||
ST7565_BlitStatusLine();
|
ST7565_BlitStatusLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
archive/f4hwn.bandscope.packed.v3.9.bin
Normal file
BIN
archive/f4hwn.bandscope.packed.v3.9.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.bandscope.packed.v3.9.sa818.bin
Normal file
BIN
archive/f4hwn.bandscope.packed.v3.9.sa818.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.broadcast.packed.v3.9.bin
Normal file
BIN
archive/f4hwn.broadcast.packed.v3.9.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.broadcast.packed.v3.9.sa818.bin
Normal file
BIN
archive/f4hwn.broadcast.packed.v3.9.sa818.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.rescueops.packed.v3.9.bin
Normal file
BIN
archive/f4hwn.rescueops.packed.v3.9.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.rescueops.packed.v3.9.sa818.bin
Normal file
BIN
archive/f4hwn.rescueops.packed.v3.9.sa818.bin
Normal file
Binary file not shown.
@@ -219,6 +219,25 @@ uint8_t cmds[] = {
|
|||||||
ST7565_Cmd(i);
|
ST7565_Cmd(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max) {
|
||||||
|
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ST7565_Gauge(uint8_t line, uint8_t min, uint8_t max, uint8_t value)
|
||||||
|
{
|
||||||
|
gFrameBuffer[line][54] = 0x0c;
|
||||||
|
gFrameBuffer[line][55] = 0x12;
|
||||||
|
|
||||||
|
gFrameBuffer[line][121] = 0x12;
|
||||||
|
gFrameBuffer[line][122] = 0x0c;
|
||||||
|
|
||||||
|
uint8_t filled = map(value, min, max, 56, 120);
|
||||||
|
|
||||||
|
for (uint8_t i = 56; i <= 120; i++) {
|
||||||
|
gFrameBuffer[line][i] = (i <= filled) ? 0x2d : 0x21;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ST7565_Init(void)
|
void ST7565_Init(void)
|
||||||
|
@@ -43,6 +43,8 @@ void ST7565_WriteByte(uint8_t Value);
|
|||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
void ST7565_ContrastAndInv(void);
|
void ST7565_ContrastAndInv(void);
|
||||||
|
void ST7565_Gauge(uint8_t line, uint8_t min, uint8_t max, uint8_t value);
|
||||||
|
int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
6
radio.c
6
radio.c
@@ -427,21 +427,19 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
|
|||||||
|
|
||||||
pVfo->Compander = att.compander;
|
pVfo->Compander = att.compander;
|
||||||
|
|
||||||
RADIO_ConfigureSquelchAndOutputPower(pVfo);
|
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||||
if(gRemoveOffset)
|
if(gRemoveOffset)
|
||||||
{
|
{
|
||||||
pVfo->pTX = &pVfo->freq_config_RX;
|
pVfo->pTX = &pVfo->freq_config_RX;
|
||||||
gRequestSaveChannel = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gPowerHigh)
|
if(gPowerHigh)
|
||||||
{
|
{
|
||||||
pVfo->OUTPUT_POWER = OUTPUT_POWER_HIGH;
|
pVfo->OUTPUT_POWER = OUTPUT_POWER_HIGH;
|
||||||
gRequestSaveChannel = 1;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RADIO_ConfigureSquelchAndOutputPower(pVfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
|
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
|
||||||
|
14
settings.c
14
settings.c
@@ -1026,3 +1026,17 @@ State[1] = 0
|
|||||||
EEPROM_WriteBuffer(0x1F88, State);
|
EEPROM_WriteBuffer(0x1F88, State);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
void SETTINGS_ResetTxLock(void)
|
||||||
|
{
|
||||||
|
uint8_t State[8];
|
||||||
|
for(uint8_t channel = 0; channel < 200; channel++)
|
||||||
|
{
|
||||||
|
uint16_t OffsetVFO = channel * 16;
|
||||||
|
EEPROM_ReadBuffer(OffsetVFO + 8, State, sizeof(State));
|
||||||
|
State[4] |= (1 << 6);
|
||||||
|
EEPROM_WriteBuffer(OffsetVFO + 8, State);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@@ -319,4 +319,7 @@ void SETTINGS_WriteBuildOptions(void);
|
|||||||
#ifdef ENABLE_FEAT_F4HWN_VOL
|
#ifdef ENABLE_FEAT_F4HWN_VOL
|
||||||
void SETTINGS_WriteCurrentVol(void);
|
void SETTINGS_WriteCurrentVol(void);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
void SETTINGS_ResetTxLock(void);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
52
ui/main.c
52
ui/main.c
@@ -53,16 +53,9 @@ center_line_t center_line = CENTER_LINE_NONE;
|
|||||||
|
|
||||||
bool isMainOnlyInputDTMF = false;
|
bool isMainOnlyInputDTMF = false;
|
||||||
|
|
||||||
static int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max) {
|
|
||||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool isMainOnly()
|
static bool isMainOnly()
|
||||||
{
|
{
|
||||||
if((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
|
return (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) && (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF);
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -281,22 +274,15 @@ void DisplayRSSIBar(const bool now)
|
|||||||
|
|
||||||
if(RxLine >= 0 && center_line != CENTER_LINE_IN_USE)
|
if(RxLine >= 0 && center_line != CENTER_LINE_IN_USE)
|
||||||
{
|
{
|
||||||
switch(RxBlink)
|
if (RxBlink == 0 || RxBlink == 1) {
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
UI_PrintStringSmallBold("RX", 8, 0, RxLine);
|
UI_PrintStringSmallBold("RX", 8, 0, RxLine);
|
||||||
break;
|
if (RxBlink == 1) RxBlink = 2;
|
||||||
case 1:
|
} else {
|
||||||
UI_PrintStringSmallBold("RX", 8, 0, RxLine);
|
|
||||||
RxBlink = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
for (uint8_t i = 8; i < 24; i++)
|
for (uint8_t i = 8; i < 24; i++)
|
||||||
{
|
{
|
||||||
gFrameBuffer[RxLine][i] = 0x00;
|
gFrameBuffer[RxLine][i] = 0x00;
|
||||||
}
|
}
|
||||||
RxBlink = 1;
|
RxBlink = 1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
ST7565_BlitLine(RxLine);
|
ST7565_BlitLine(RxLine);
|
||||||
}
|
}
|
||||||
@@ -1070,10 +1056,11 @@ void UI_DisplayMain(void)
|
|||||||
// ************
|
// ************
|
||||||
|
|
||||||
{ // show the TX/RX level
|
{ // show the TX/RX level
|
||||||
uint8_t Level = 0;
|
int8_t Level = -1;
|
||||||
|
|
||||||
if (mode == VFO_MODE_TX)
|
if (mode == VFO_MODE_TX)
|
||||||
{ // TX power level
|
{ // TX power level
|
||||||
|
/*
|
||||||
switch (gRxVfo->OUTPUT_POWER)
|
switch (gRxVfo->OUTPUT_POWER)
|
||||||
{
|
{
|
||||||
case OUTPUT_POWER_LOW1: Level = 2; break;
|
case OUTPUT_POWER_LOW1: Level = 2; break;
|
||||||
@@ -1084,6 +1071,16 @@ void UI_DisplayMain(void)
|
|||||||
case OUTPUT_POWER_MID: Level = 4; break;
|
case OUTPUT_POWER_MID: Level = 4; break;
|
||||||
case OUTPUT_POWER_HIGH: Level = 6; break;
|
case OUTPUT_POWER_HIGH: Level = 6; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_MID) {
|
||||||
|
Level = 4;
|
||||||
|
} else if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_HIGH) {
|
||||||
|
Level = 6;
|
||||||
|
} else {
|
||||||
|
Level = 2;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
Level = gRxVfo->OUTPUT_POWER - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (mode == VFO_MODE_RX)
|
if (mode == VFO_MODE_RX)
|
||||||
@@ -1094,7 +1091,7 @@ void UI_DisplayMain(void)
|
|||||||
Level = gVFO_RSSI_bar_level[vfo_num];
|
Level = gVFO_RSSI_bar_level[vfo_num];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(Level)
|
if(Level >= 0)
|
||||||
DrawSmallAntennaAndBars(p_line1 + LCD_WIDTH, Level);
|
DrawSmallAntennaAndBars(p_line1 + LCD_WIDTH, Level);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1339,6 +1336,7 @@ void UI_DisplayMain(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
/*
|
||||||
if(isMainVFO)
|
if(isMainVFO)
|
||||||
{
|
{
|
||||||
if(gMonitor)
|
if(gMonitor)
|
||||||
@@ -1363,6 +1361,20 @@ void UI_DisplayMain(void)
|
|||||||
GUI_DisplaySmallest(String, 110, line == 0 ? 17 : 49, false, true);
|
GUI_DisplaySmallest(String, 110, line == 0 ? 17 : 49, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (isMainVFO) {
|
||||||
|
if (gMonitor) {
|
||||||
|
sprintf(String, "MONI");
|
||||||
|
} else {
|
||||||
|
sprintf(String, "SQL%d", gEeprom.SQUELCH_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gSetting_set_gui) {
|
||||||
|
UI_PrintStringSmallNormal(String, LCD_WIDTH + 98, 0, line + 1);
|
||||||
|
} else {
|
||||||
|
GUI_DisplaySmallest(String, 110, line == 0 ? 17 : 49, false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
ui/menu.c
13
ui/menu.c
@@ -70,9 +70,11 @@ const t_menu_item MenuList[] =
|
|||||||
{"SList2", MENU_SLIST2 },
|
{"SList2", MENU_SLIST2 },
|
||||||
{"SList3", MENU_SLIST3 },
|
{"SList3", MENU_SLIST3 },
|
||||||
{"ScnRev", MENU_SC_REV },
|
{"ScnRev", MENU_SC_REV },
|
||||||
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
{"NOAA-S", MENU_NOAA_S },
|
{"NOAA-S", MENU_NOAA_S },
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
{"F1Shrt", MENU_F1SHRT },
|
{"F1Shrt", MENU_F1SHRT },
|
||||||
{"F1Long", MENU_F1LONG },
|
{"F1Long", MENU_F1LONG },
|
||||||
{"F2Shrt", MENU_F2SHRT },
|
{"F2Shrt", MENU_F2SHRT },
|
||||||
@@ -161,6 +163,9 @@ const t_menu_item MenuList[] =
|
|||||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||||
{"SetKey", MENU_SET_KEY },
|
{"SetKey", MENU_SET_KEY },
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NOAA
|
||||||
|
{"SetNWR", MENU_NOAA_S },
|
||||||
|
#endif
|
||||||
#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
|
||||||
@@ -701,6 +706,7 @@ void UI_DisplayMenu(void)
|
|||||||
else if(gSubMenuSelection < 61)
|
else if(gSubMenuSelection < 61)
|
||||||
{
|
{
|
||||||
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection) * 5) / 60), (((gSubMenuSelection) * 5) % 60));
|
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection) * 5) / 60), (((gSubMenuSelection) * 5) % 60));
|
||||||
|
ST7565_Gauge(4, 1, 60, gSubMenuSelection);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -730,7 +736,10 @@ void UI_DisplayMenu(void)
|
|||||||
if (gSubMenuSelection == 0)
|
if (gSubMenuSelection == 0)
|
||||||
strcpy(String, "OFF");
|
strcpy(String, "OFF");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
sprintf(String, "%02dm:%02ds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
|
sprintf(String, "%02dm:%02ds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
|
||||||
|
ST7565_Gauge(4, 1, 40, gSubMenuSelection);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_COMPAND:
|
case MENU_COMPAND:
|
||||||
@@ -844,6 +853,7 @@ void UI_DisplayMenu(void)
|
|||||||
|
|
||||||
case MENU_TOT:
|
case MENU_TOT:
|
||||||
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection + 1) * 5) / 60), (((gSubMenuSelection + 1) * 5) % 60));
|
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection + 1) * 5) / 60), (((gSubMenuSelection + 1) * 5) % 60));
|
||||||
|
ST7565_Gauge(4, 5, 179, gSubMenuSelection);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
@@ -860,10 +870,12 @@ void UI_DisplayMenu(void)
|
|||||||
else if(gSubMenuSelection < 81)
|
else if(gSubMenuSelection < 81)
|
||||||
{
|
{
|
||||||
sprintf(String, "CARRIER\n%02ds:%03dms", ((gSubMenuSelection * 250) / 1000), ((gSubMenuSelection * 250) % 1000));
|
sprintf(String, "CARRIER\n%02ds:%03dms", ((gSubMenuSelection * 250) / 1000), ((gSubMenuSelection * 250) % 1000));
|
||||||
|
ST7565_Gauge(5, 1, 80, gSubMenuSelection);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(String, "TIMEOUT\n%02dm:%02ds", (((gSubMenuSelection - 80) * 5) / 60), (((gSubMenuSelection - 80) * 5) % 60));
|
sprintf(String, "TIMEOUT\n%02dm:%02ds", (((gSubMenuSelection - 80) * 5) / 60), (((gSubMenuSelection - 80) * 5) % 60));
|
||||||
|
ST7565_Gauge(5, 80, 104, gSubMenuSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1015,6 +1027,7 @@ void UI_DisplayMenu(void)
|
|||||||
else if(gSubMenuSelection < 121)
|
else if(gSubMenuSelection < 121)
|
||||||
{
|
{
|
||||||
sprintf(String, "%dh:%02dm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
|
sprintf(String, "%dh:%02dm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
|
||||||
|
ST7565_Gauge(4, 1, 120, gSubMenuSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -110,9 +110,11 @@ enum
|
|||||||
#ifdef ENABLE_AM_FIX
|
#ifdef ENABLE_AM_FIX
|
||||||
MENU_AM_FIX,
|
MENU_AM_FIX,
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
MENU_NOAA_S,
|
MENU_NOAA_S,
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
MENU_RESET,
|
MENU_RESET,
|
||||||
MENU_F_LOCK,
|
MENU_F_LOCK,
|
||||||
#ifndef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
@@ -150,6 +152,9 @@ enum
|
|||||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||||
MENU_SET_KEY,
|
MENU_SET_KEY,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NOAA
|
||||||
|
MENU_NOAA_S,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
MENU_BATCAL, // battery voltage calibration
|
MENU_BATCAL, // battery voltage calibration
|
||||||
MENU_F1SHRT,
|
MENU_F1SHRT,
|
||||||
|
55
ui/status.c
55
ui/status.c
@@ -40,12 +40,12 @@ static void convertTime(uint8_t *line, uint8_t type)
|
|||||||
uint16_t t = (type == 0) ? (gTxTimerCountdown_500ms / 2) : (3600 - gRxTimerCountdown_500ms / 2);
|
uint16_t t = (type == 0) ? (gTxTimerCountdown_500ms / 2) : (3600 - gRxTimerCountdown_500ms / 2);
|
||||||
|
|
||||||
uint8_t m = t / 60;
|
uint8_t m = t / 60;
|
||||||
uint8_t s = t % 60; // Utilisation de l'opérateur modulo pour simplifier le calcul des secondes
|
uint8_t s = t - (m * 60); // Replace modulo with subtraction for efficiency
|
||||||
|
|
||||||
gStatusLine[0] = gStatusLine[7] = gStatusLine[14] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
gStatusLine[0] = gStatusLine[7] = gStatusLine[14] = 0x00; // Quick fix on display (on scanning I, II, etc.)
|
||||||
|
|
||||||
char str[8];
|
char str[6];
|
||||||
sprintf(str, "%02d:%02d", m, s);
|
sprintf(str, "%02u:%02u", m, s);
|
||||||
UI_PrintStringSmallBufferNormal(str, line);
|
UI_PrintStringSmallBufferNormal(str, line);
|
||||||
|
|
||||||
gUpdateStatus = true;
|
gUpdateStatus = true;
|
||||||
@@ -61,23 +61,27 @@ void UI_DisplayStatus()
|
|||||||
|
|
||||||
uint8_t *line = gStatusLine;
|
uint8_t *line = gStatusLine;
|
||||||
unsigned int x = 0;
|
unsigned int x = 0;
|
||||||
// **************
|
|
||||||
|
|
||||||
// POWER-SAVE indicator
|
#ifdef ENABLE_NOAA
|
||||||
|
// NOAA indicator
|
||||||
|
if (!(gScanStateDir != SCAN_OFF || SCANNER_IsScanning()) && gIsNoaaMode) { // NOASS SCAN indicator
|
||||||
|
memcpy(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
|
||||||
|
}
|
||||||
|
// Power Save indicator
|
||||||
|
else if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
||||||
|
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
||||||
|
}
|
||||||
|
x += 8;
|
||||||
|
#else
|
||||||
|
// Power Save indicator
|
||||||
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
||||||
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
||||||
}
|
}
|
||||||
x += 8;
|
x += 8;
|
||||||
unsigned int x1 = x;
|
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
|
||||||
if (gIsNoaaMode) { // NOASS SCAN indicator
|
|
||||||
memcpy(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
|
|
||||||
x1 = x + sizeof(BITMAP_NOAA);
|
|
||||||
}
|
|
||||||
x += sizeof(BITMAP_NOAA);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
unsigned int x1 = x;
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_CALLING
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
if (gSetting_KILLED) {
|
if (gSetting_KILLED) {
|
||||||
memset(line + x, 0xFF, 10);
|
memset(line + x, 0xFF, 10);
|
||||||
@@ -206,7 +210,7 @@ void UI_DisplayStatus()
|
|||||||
x += sizeof(gFontPttClassic) + 3;
|
x += sizeof(gFontPttClassic) + 3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x = MAX(x1, 70u);
|
x = MAX(x1, 69u);
|
||||||
|
|
||||||
// KEY-LOCK indicator
|
// KEY-LOCK indicator
|
||||||
if (gEeprom.KEY_LOCK) {
|
if (gEeprom.KEY_LOCK) {
|
||||||
@@ -237,28 +241,37 @@ void UI_DisplayStatus()
|
|||||||
|
|
||||||
UI_DrawBattery(line + x2, gBatteryDisplayLevel, gLowBatteryBlink);
|
UI_DrawBattery(line + x2, gBatteryDisplayLevel, gLowBatteryBlink);
|
||||||
|
|
||||||
|
bool BatTxt = true;
|
||||||
|
|
||||||
switch (gSetting_battery_text) {
|
switch (gSetting_battery_text) {
|
||||||
default:
|
default:
|
||||||
case 0:
|
case 0:
|
||||||
|
BatTxt = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: { // voltage
|
case 1: // voltage
|
||||||
const uint16_t voltage = (gBatteryVoltageAverage <= 999) ? gBatteryVoltageAverage : 999; // limit to 9.99V
|
const uint16_t voltage = (gBatteryVoltageAverage <= 999) ? gBatteryVoltageAverage : 999; // limit to 9.99V
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
|
||||||
sprintf(str, "%u.%02u", voltage / 100, voltage % 100);
|
sprintf(str, "%u.%02u", voltage / 100, voltage % 100);
|
||||||
#else
|
|
||||||
sprintf(str, "%u.%02uV", voltage / 100, voltage % 100);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 2: // percentage
|
case 2: // percentage
|
||||||
sprintf(str, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
//gBatteryVoltageAverage = 999;
|
||||||
|
sprintf(str, "%02u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BatTxt) {
|
||||||
x2 -= (7 * strlen(str));
|
x2 -= (7 * strlen(str));
|
||||||
UI_PrintStringSmallBufferNormal(str, line + x2);
|
UI_PrintStringSmallBufferNormal(str, line + x2);
|
||||||
|
/*
|
||||||
|
uint8_t shift = (strlen(str) < 5) ? 92 : 88;
|
||||||
|
GUI_DisplaySmallest(str, shift, 1, true, true);
|
||||||
|
|
||||||
|
for (uint8_t i = shift - 2; i < 110; i++) {
|
||||||
|
gStatusLine[i] ^= 0x7F; // invert
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
// **************
|
// **************
|
||||||
|
|
||||||
|
@@ -119,17 +119,13 @@ void UI_DisplayWelcome(void)
|
|||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
UI_PrintStringSmallNormal(Version, 0, 128, 4);
|
UI_PrintStringSmallNormal(Version, 0, 128, 4);
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 128; i++)
|
UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64
|
||||||
{
|
|
||||||
gFrameBuffer[3][i] ^= 0x80;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uint8_t i = 18; i < 110; i++)
|
for (uint8_t i = 18; i < 110; i++)
|
||||||
{
|
{
|
||||||
gFrameBuffer[4][i] ^= 0xFF;
|
gFrameBuffer[4][i] ^= 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sprintf(WelcomeString3, "%s Edition", Edition);
|
sprintf(WelcomeString3, "%s Edition", Edition);
|
||||||
UI_PrintStringSmallNormal(WelcomeString3, 0, 127, 6);
|
UI_PrintStringSmallNormal(WelcomeString3, 0, 127, 6);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user