Merge pull request #229 from mrkusypl/feature_update_v5_2

Minor code refactoring (24 B)
This commit is contained in:
Armel FAUVEAU authored and GitHub committed 2026-03-22 04:08:24 +01:00
commit 688b3a5c77
4 files changed
+27 -41

No files matched your search

+1 -3
View File
@@ -36,9 +36,7 @@ void UI_DisplayFM(void)
UI_DisplayClear();
#ifdef ENABLE_FEAT_F4HWN
if (gEeprom.KEY_LOCK && gKeypadLocked > 0) {
UI_PrintStringSmallBold("UNLOCK KEYBOARD", 12, 0, 5);
}
UI_DisplayUnlockKeyboard(5);
#endif
UI_PrintString("FM", 2, 0, 0, 8);
+18
View File
@@ -22,6 +22,7 @@
#include "ui/helper.h"
#include "ui/inputbox.h"
#include "misc.h"
#include "settings.h"
void UI_GenerateChannelString(char *pString, const uint16_t Channel)
@@ -322,6 +323,23 @@ static void sort(int16_t *a, int16_t *b)
}
}
void UI_DisplayUnlockKeyboard(uint8_t shift) {
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
{ // tell user how to unlock the keyboard
//memcpy(gFrameBuffer[shift] + 2, gFontKeyLock, sizeof(gFontKeyLock));
UI_PrintStringSmallBold("UNLOCK KEYBOARD", 12, 0, shift);
//memcpy(gFrameBuffer[shift] + 120, gFontKeyLock, sizeof(gFontKeyLock));
/*
for (uint8_t i = 12; i < 116; i++)
{
gFrameBuffer[shift][i] ^= 0xFF;
}
*/
}
}
bool IsEmptyName(const char *name, uint8_t len) {
if (name[0] == '\0' || name[0] == '\xff')
return true;
+1
View File
@@ -38,6 +38,7 @@ void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black
void PutPixel(uint8_t x, uint8_t y, bool fill);
void PutPixelStatus(uint8_t x, uint8_t y, bool fill);
void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y, bool statusbar, bool fill);
void UI_DisplayUnlockKeyboard(uint8_t shift);
bool IsEmptyName(const char *name, uint8_t len);
#endif
void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black);
+7 -38
View File
@@ -77,19 +77,13 @@ static void DrawSmallPowerBars(uint8_t *p, unsigned int level)
if(level>6)
level = 6;
if(gSetting_set_gui)
{
for(uint8_t i = 0; i <= level; i++) {
char bar = (0xff << (6-i)) & 0x7F;
memset(p + 2 + i*3, bar, 2);
}
}
else
{
for(uint8_t i = 0; i <= level; i++) {
char bar = 0b00111110;
memset(p + 2 + i*3, bar, 2);
char bar = 0b00111110;
for(uint8_t i = 0; i <= level; i++) {
if(gSetting_set_gui) {
bar = (0xff << (6-i)) & 0x7F;
}
memset(p + 2 + i*3, bar, 2);
}
}
#if defined ENABLE_AUDIO_BAR || defined ENABLE_RSSI_BAR
@@ -563,32 +557,7 @@ void UI_DisplayMain(void)
return;
}
#else
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
{ // tell user how to unlock the keyboard
uint8_t shift = 3;
/*
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true);
SYSTEM_DelayMs(50);
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false);
SYSTEM_DelayMs(50);
*/
if(isMainOnly())
{
shift = 5;
}
//memcpy(gFrameBuffer[shift] + 2, gFontKeyLock, sizeof(gFontKeyLock));
UI_PrintStringSmallBold("UNLOCK KEYBOARD", 12, 0, shift);
//memcpy(gFrameBuffer[shift] + 120, gFontKeyLock, sizeof(gFontKeyLock));
/*
for (uint8_t i = 12; i < 116; i++)
{
gFrameBuffer[shift][i] ^= 0xFF;
}
*/
}
UI_DisplayUnlockKeyboard(isMainOnly() ? 5 : 3);
#endif
unsigned int activeTxVFO = gRxVfoIsActive ? gEeprom.RX_VFO : gEeprom.TX_VFO;