2
Makefile
2
Makefile
@@ -211,7 +211,7 @@ 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 ?= v2.5
|
VERSION_STRING_2 ?= v2.6
|
||||||
|
|
||||||
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)
|
||||||
|
13
README.md
13
README.md
@@ -22,7 +22,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, Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB and Jean-Claude 14FRS3306 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, Laurent F4AXK, Christophe Morel, Clayton W0LED, Pierre Antoine F6FWB, Jean-Claude 14FRS3306 and Thierry F4GVO for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
@@ -42,8 +42,8 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
|
|||||||
* improve default power settings level (Low ~125mW, Mid ~2W and High ~5W),
|
* improve default power settings level (Low ~125mW, Mid ~2W and High ~5W),
|
||||||
* improve s-meter (IARU recommandations),
|
* improve s-meter (IARU recommandations),
|
||||||
* improve UI:
|
* improve UI:
|
||||||
* menu index,
|
* menu index is always visible, even if a menu is selected,
|
||||||
* s-meter design,
|
* s-meter new design (Classic or Tiny),
|
||||||
* MAIN ONLY screen mode,
|
* MAIN ONLY screen mode,
|
||||||
* DUAL and CROSS screen mode,
|
* DUAL and CROSS screen mode,
|
||||||
* RX blink on VFO RX,
|
* RX blink on VFO RX,
|
||||||
@@ -53,6 +53,9 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
|
|||||||
* CTCSS or DCS value,
|
* CTCSS or DCS value,
|
||||||
* KeyLock message,
|
* KeyLock message,
|
||||||
* last RX,
|
* last RX,
|
||||||
|
* move BatTxt menu from 34/63 to 30/63 (just after BatSave menu 29/63),
|
||||||
|
* rename BackLt to BLTime,
|
||||||
|
* rename BltTRX to BLTxRx,
|
||||||
* and more...
|
* and more...
|
||||||
* new menu entries:
|
* new menu entries:
|
||||||
* add SetLow menu to set low power (<20mW, 125mW, 250mW, 500mW and 1W),
|
* add SetLow menu to set low power (<20mW, 125mW, 250mW, 500mW and 1W),
|
||||||
@@ -71,12 +74,14 @@ Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC
|
|||||||
* improve status bar,
|
* improve status bar,
|
||||||
* add SetPtt mode in status bar,
|
* add SetPtt mode in status bar,
|
||||||
* change font and bitmaps,
|
* change font and bitmaps,
|
||||||
|
* move USB icon to left of battery information,
|
||||||
|
* add RX and TX timers,
|
||||||
* new actions:
|
* new actions:
|
||||||
* SWITCH RxMode,
|
* SWITCH RxMode,
|
||||||
* SWITCH PTT,
|
* SWITCH PTT,
|
||||||
* SWITCH WIDE NARROW,
|
* SWITCH WIDE NARROW,
|
||||||
* 1750Hz,
|
* 1750Hz,
|
||||||
* BlMin Tmp Pff,
|
* BlMin Tmp Off,
|
||||||
* new key combinations:
|
* new key combinations:
|
||||||
* add the F + UP or F + DOWN key combination to dynamically change the Squelch level,
|
* add the F + UP or F + DOWN key combination to dynamically change the Squelch level,
|
||||||
* add the F + F1 or F + F2 key combination to dynamically change the Step,
|
* add the F + F1 or F + F2 key combination to dynamically change the Step,
|
||||||
|
@@ -125,6 +125,8 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
|||||||
|
|
||||||
//SETTINGS_SaveChannel(channel, gEeprom.RX_VFO, gRxVfo, 1);
|
//SETTINGS_SaveChannel(channel, gEeprom.RX_VFO, gRxVfo, 1);
|
||||||
|
|
||||||
|
gRequestSaveChannel = 1;
|
||||||
|
|
||||||
gUpdateDisplay = true;
|
gUpdateDisplay = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
BIN
archive/f4hwn.packed.v2.6.bin
Normal file
BIN
archive/f4hwn.packed.v2.6.bin
Normal file
Binary file not shown.
BIN
archive/f4hwn.packed.v2.6.fixed.bin
Normal file
BIN
archive/f4hwn.packed.v2.6.fixed.bin
Normal file
Binary file not shown.
14
bitmaps.c
14
bitmaps.c
@@ -11,16 +11,6 @@ const uint8_t gFontPowerSave[2][6] =
|
|||||||
{0x00, 0x26, 0x49, 0x49, 0x49, 0x32},
|
{0x00, 0x26, 0x49, 0x49, 0x49, 0x32},
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t gFontTx[1][5] =
|
|
||||||
{
|
|
||||||
{0x3, 0x1, 0x7f, 0x1, 0x3},
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t gFontRx[1][5] =
|
|
||||||
{
|
|
||||||
{0x7f, 0x9, 0x19, 0x29, 0x46},
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t gFontPttOnePush[2][6] =
|
const uint8_t gFontPttOnePush[2][6] =
|
||||||
{
|
{
|
||||||
{0x00, 0x3e, 0x41, 0x41, 0x41, 0x3e},
|
{0x00, 0x3e, 0x41, 0x41, 0x41, 0x3e},
|
||||||
@@ -39,9 +29,9 @@ const uint8_t gFontFM[2][6] =
|
|||||||
{0x00, 0x7f, 0x2, 0x1c, 0x2, 0x7f},
|
{0x00, 0x7f, 0x2, 0x1c, 0x2, 0x7f},
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t gFontKeyLock[1][8] =
|
const uint8_t gFontKeyLock[1][9] =
|
||||||
{
|
{
|
||||||
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
|
{0x7c, 0x46, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x7c}
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t gFontScanAll[9] =
|
const uint8_t gFontScanAll[9] =
|
||||||
|
@@ -5,12 +5,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern const uint8_t gFontPowerSave[2][6];
|
extern const uint8_t gFontPowerSave[2][6];
|
||||||
extern const uint8_t gFontTx[1][5];
|
|
||||||
extern const uint8_t gFontRx[1][5];
|
|
||||||
extern const uint8_t gFontPttOnePush[2][6];
|
extern const uint8_t gFontPttOnePush[2][6];
|
||||||
extern const uint8_t gFontPttClassic[2][6];
|
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][9];
|
||||||
extern const uint8_t gFontScanAll[9];
|
extern const uint8_t gFontScanAll[9];
|
||||||
extern const uint8_t gFontLight[9];
|
extern const uint8_t gFontLight[9];
|
||||||
|
|
||||||
|
@@ -210,6 +210,7 @@ void FUNCTION_Transmit()
|
|||||||
AUDIO_AudioPathOn();
|
AUDIO_AudioPathOn();
|
||||||
gEnableSpeaker = true;
|
gEnableSpeaker = true;
|
||||||
|
|
||||||
|
gVfoConfigureMode = VFO_CONFIGURE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
1
misc.c
1
misc.c
@@ -159,6 +159,7 @@ volatile bool gTxTimeoutReached;
|
|||||||
volatile uint16_t gTxTimerCountdownAlert_500ms;
|
volatile uint16_t gTxTimerCountdownAlert_500ms;
|
||||||
volatile bool gTxTimeoutReachedAlert;
|
volatile bool gTxTimeoutReachedAlert;
|
||||||
volatile uint16_t gTxTimeoutToneAlert = 800;
|
volatile uint16_t gTxTimeoutToneAlert = 800;
|
||||||
|
volatile uint16_t gRxTimerCountdown_500ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
1
misc.h
1
misc.h
@@ -222,6 +222,7 @@ extern volatile bool gTxTimeoutReached;
|
|||||||
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
|
extern volatile uint16_t gTxTimerCountdownAlert_500ms;
|
||||||
extern volatile bool gTxTimeoutReachedAlert;
|
extern volatile bool gTxTimeoutReachedAlert;
|
||||||
extern volatile uint16_t gTxTimeoutToneAlert;
|
extern volatile uint16_t gTxTimeoutToneAlert;
|
||||||
|
extern volatile uint16_t gRxTimerCountdown_500ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
@@ -58,6 +58,7 @@ void SystickHandler(void)
|
|||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdownAlert_500ms - ALERT_TOT * 2, gTxTimeoutReachedAlert);
|
||||||
|
DECREMENT(gRxTimerCountdown_500ms);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
DECREMENT_AND_TRIGGER(gTxTimerCountdown_500ms, gTxTimeoutReached);
|
||||||
|
12
ui/main.c
12
ui/main.c
@@ -53,6 +53,10 @@ 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(bool checkGui)
|
static bool isMainOnly(bool checkGui)
|
||||||
{
|
{
|
||||||
if(checkGui)
|
if(checkGui)
|
||||||
@@ -252,12 +256,6 @@ void UI_DisplayAudioBar(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void DisplayRSSIBar(const bool now)
|
void DisplayRSSIBar(const bool now)
|
||||||
{
|
{
|
||||||
#if defined(ENABLE_RSSI_BAR)
|
#if defined(ENABLE_RSSI_BAR)
|
||||||
@@ -800,6 +798,8 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
gRxTimerCountdown_500ms = 7200;
|
||||||
|
|
||||||
if(RxOnVfofrequency == frequency && !isMainOnly(false))
|
if(RxOnVfofrequency == frequency && !isMainOnly(false))
|
||||||
{
|
{
|
||||||
UI_PrintStringSmallNormal(">>", 14, 0, line);
|
UI_PrintStringSmallNormal(">>", 14, 0, line);
|
||||||
|
16
ui/menu.c
16
ui/menu.c
@@ -77,17 +77,17 @@ const t_menu_item MenuList[] =
|
|||||||
{"KeyLck", MENU_AUTOLK }, // was "AUTOLk"
|
{"KeyLck", MENU_AUTOLK }, // was "AUTOLk"
|
||||||
{"TxTOut", MENU_TOT }, // was "TOT"
|
{"TxTOut", MENU_TOT }, // was "TOT"
|
||||||
{"BatSav", MENU_SAVE }, // was "SAVE"
|
{"BatSav", MENU_SAVE }, // was "SAVE"
|
||||||
|
{"BatTxt", MENU_BAT_TXT },
|
||||||
{"Mic", MENU_MIC },
|
{"Mic", MENU_MIC },
|
||||||
#ifdef ENABLE_AUDIO_BAR
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
{"MicBar", MENU_MIC_BAR },
|
{"MicBar", MENU_MIC_BAR },
|
||||||
#endif
|
#endif
|
||||||
{"ChDisp", MENU_MDF }, // was "MDF"
|
{"ChDisp", MENU_MDF }, // was "MDF"
|
||||||
{"POnMsg", MENU_PONMSG },
|
{"POnMsg", MENU_PONMSG },
|
||||||
{"BatTxt", MENU_BAT_TXT },
|
{"BLTime", MENU_ABR }, // was "ABR"
|
||||||
{"BackLt", MENU_ABR }, // was "ABR"
|
|
||||||
{"BLMin", MENU_ABR_MIN },
|
{"BLMin", MENU_ABR_MIN },
|
||||||
{"BLMax", MENU_ABR_MAX },
|
{"BLMax", MENU_ABR_MAX },
|
||||||
{"BltTRX", MENU_ABR_ON_TX_RX },
|
{"BLTxRx", MENU_ABR_ON_TX_RX },
|
||||||
{"Beep", MENU_BEEP },
|
{"Beep", MENU_BEEP },
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
{"Voice", MENU_VOICE },
|
{"Voice", MENU_VOICE },
|
||||||
@@ -516,10 +516,7 @@ void UI_DisplayMenu(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// draw the menu index number/count
|
// draw the menu index number/count
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifndef ENABLE_FEAT_F4HWN
|
||||||
sprintf(String, "%02u/%u", 1 + gMenuCursor, gMenuListCount);
|
|
||||||
UI_PrintStringSmallNormal(String, 6, 0, 6);
|
|
||||||
#else
|
|
||||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||||
#endif
|
#endif
|
||||||
@@ -530,6 +527,11 @@ void UI_DisplayMenu(void)
|
|||||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
||||||
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
sprintf(String, "%02u/%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
|
UI_PrintStringSmallNormal(String, 6, 0, 6);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
89
ui/status.c
89
ui/status.c
@@ -34,8 +34,33 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void convertTime(uint8_t *line, uint8_t type)
|
||||||
|
{
|
||||||
|
char str[8] = "";
|
||||||
|
|
||||||
|
uint8_t m, s; // Declare variables for seconds, hours, minutes, and seconds
|
||||||
|
uint16_t t;
|
||||||
|
|
||||||
|
if(type == 0) // Tx timer
|
||||||
|
t = (gTxTimerCountdown_500ms / 2);
|
||||||
|
//t = ((gEeprom.TX_TIMEOUT_TIMER + 1) * 5) - (gTxTimerCountdown_500ms / 2);
|
||||||
|
else // Rx timer
|
||||||
|
t = 3600 - (gRxTimerCountdown_500ms / 2);
|
||||||
|
|
||||||
|
m = t / 60;
|
||||||
|
s = t - (m * 60);
|
||||||
|
|
||||||
|
sprintf(str, "%02d:%02d", m, s);
|
||||||
|
UI_PrintStringSmallBufferNormal(str, line + 0);
|
||||||
|
|
||||||
|
gUpdateStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
void UI_DisplayStatus()
|
void UI_DisplayStatus()
|
||||||
{
|
{
|
||||||
|
char str[8] = "";
|
||||||
|
|
||||||
gUpdateStatus = false;
|
gUpdateStatus = false;
|
||||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||||
|
|
||||||
@@ -44,13 +69,7 @@ void UI_DisplayStatus()
|
|||||||
// **************
|
// **************
|
||||||
|
|
||||||
// POWER-SAVE indicator
|
// POWER-SAVE indicator
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT) {
|
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
||||||
memcpy(line + x, gFontTx, sizeof(gFontTx));
|
|
||||||
}
|
|
||||||
else if (FUNCTION_IsRx()) {
|
|
||||||
memcpy(line + x, gFontRx, sizeof(gFontRx));
|
|
||||||
}
|
|
||||||
else if (gCurrentFunction == FUNCTION_POWER_SAVE) {
|
|
||||||
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
memcpy(line + x, gFontPowerSave, sizeof(gFontPowerSave));
|
||||||
}
|
}
|
||||||
x += 8;
|
x += 8;
|
||||||
@@ -108,9 +127,8 @@ void UI_DisplayStatus()
|
|||||||
bool debug = false;
|
bool debug = false;
|
||||||
if(debug)
|
if(debug)
|
||||||
{
|
{
|
||||||
char sDebug[8] = "";
|
sprintf(str, "%d", gDebug);
|
||||||
sprintf(sDebug, "%d", gDebug);
|
UI_PrintStringSmallBufferNormal(str, line + x + 1);
|
||||||
UI_PrintStringSmallBufferNormal(sDebug, line + x + 1);
|
|
||||||
x += 16;
|
x += 16;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -126,6 +144,16 @@ void UI_DisplayStatus()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!SCANNER_IsScanning()) {
|
if(!SCANNER_IsScanning()) {
|
||||||
|
if(gCurrentFunction == FUNCTION_TRANSMIT)
|
||||||
|
{
|
||||||
|
convertTime(line, 0);
|
||||||
|
}
|
||||||
|
else if(FUNCTION_IsRx())
|
||||||
|
{
|
||||||
|
convertTime(line, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
|
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
|
||||||
if(dw == 1 || dw == 3) { // DWR - dual watch + respond
|
if(dw == 1 || dw == 3) { // DWR - dual watch + respond
|
||||||
if(gDualWatchActive)
|
if(gDualWatchActive)
|
||||||
@@ -141,6 +169,7 @@ void UI_DisplayStatus()
|
|||||||
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
|
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
x += sizeof(gFontDWR) + 3;
|
x += sizeof(gFontDWR) + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,31 +201,28 @@ void UI_DisplayStatus()
|
|||||||
// KEY-LOCK indicator
|
// KEY-LOCK indicator
|
||||||
if (gEeprom.KEY_LOCK) {
|
if (gEeprom.KEY_LOCK) {
|
||||||
memcpy(line + x + 1, gFontKeyLock, sizeof(gFontKeyLock));
|
memcpy(line + x + 1, gFontKeyLock, sizeof(gFontKeyLock));
|
||||||
x += sizeof(gFontKeyLock);
|
|
||||||
x1 = x;
|
|
||||||
}
|
}
|
||||||
else if (gWasFKeyPressed) {
|
else if (gWasFKeyPressed) {
|
||||||
UI_PrintStringSmallBufferNormal("F", line + x + 1);
|
UI_PrintStringSmallBufferNormal("F", line + x + 1);
|
||||||
x += sizeof(gFontKeyLock);
|
|
||||||
|
|
||||||
for (uint8_t i = 71; i < 79; i++)
|
for (uint8_t i = 71; i < 79; i++)
|
||||||
{
|
{
|
||||||
gStatusLine[i] ^= 0x7F;
|
gStatusLine[i] ^= 0x7F;
|
||||||
}
|
}
|
||||||
x1 = x;
|
|
||||||
}
|
}
|
||||||
else if (gBackLight)
|
else if (gBackLight)
|
||||||
{
|
{
|
||||||
memcpy(line + x + 1, gFontLight, sizeof(gFontLight));
|
memcpy(line + x + 1, gFontLight, sizeof(gFontLight));
|
||||||
x += sizeof(gFontLight);
|
}
|
||||||
x1 = x;
|
else if (gChargingWithTypeC)
|
||||||
|
{
|
||||||
|
memcpy(line + x + 1, BITMAP_USB_C, sizeof(BITMAP_USB_C));
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // battery voltage or percentage
|
// Battery
|
||||||
char s[8] = "";
|
|
||||||
unsigned int x2 = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - 0;
|
unsigned int x2 = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - 0;
|
||||||
if (gChargingWithTypeC)
|
|
||||||
x2 -= sizeof(BITMAP_USB_C); // the radio is on charge
|
UI_DrawBattery(line + x2, gBatteryDisplayLevel, gLowBatteryBlink);
|
||||||
|
|
||||||
switch (gSetting_battery_text) {
|
switch (gSetting_battery_text) {
|
||||||
default:
|
default:
|
||||||
@@ -206,33 +232,20 @@ void UI_DisplayStatus()
|
|||||||
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
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
sprintf(s, "%u.%02u", voltage / 100, voltage % 100);
|
sprintf(str, "%u.%02u", voltage / 100, voltage % 100);
|
||||||
#else
|
#else
|
||||||
sprintf(s, "%u.%02uV", voltage / 100, voltage % 100);
|
sprintf(str, "%u.%02uV", voltage / 100, voltage % 100);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2: // percentage
|
case 2: // percentage
|
||||||
sprintf(s, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
sprintf(str, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int space_needed = (7 * strlen(s));
|
x2 -= (7 * strlen(str));
|
||||||
if (x2 >= (x1 + space_needed))
|
UI_PrintStringSmallBufferNormal(str, line + x2);
|
||||||
UI_PrintStringSmallBufferNormal(s, line + x2 - space_needed);
|
|
||||||
}
|
|
||||||
|
|
||||||
// move to right side of the screen
|
|
||||||
x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - sizeof(BITMAP_USB_C);
|
|
||||||
|
|
||||||
// USB-C charge indicator
|
|
||||||
if (gChargingWithTypeC)
|
|
||||||
memcpy(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
|
|
||||||
x += sizeof(BITMAP_USB_C);
|
|
||||||
|
|
||||||
// BATTERY LEVEL indicator
|
|
||||||
UI_DrawBattery(line + x, gBatteryDisplayLevel, gLowBatteryBlink);
|
|
||||||
|
|
||||||
// **************
|
// **************
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user