mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-22 02:08:48 +00:00
Stop signal bar graph showing when keylock msg + fix bat symbol bug
This commit is contained in:
parent
28ed7e7842
commit
787b5add92
@ -1321,7 +1321,6 @@ void APP_Update(void)
|
||||
DUALWATCH_Alternate(); // toggle between the two VFO's
|
||||
|
||||
gUpdateRSSI = true;
|
||||
|
||||
gBatterySave_10ms = 10; // 100ms
|
||||
}
|
||||
|
||||
|
15
bitmaps.c
15
bitmaps.c
@ -29,7 +29,7 @@ const uint8_t BITMAP_PowerSave[8] =
|
||||
#endif
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_BatteryLevel1[18] =
|
||||
const uint8_t BITMAP_BatteryLevel1[17] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111110,
|
||||
@ -47,11 +47,10 @@ const uint8_t BITMAP_BatteryLevel1[18] =
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01111111
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_BatteryLevel2[18] =
|
||||
const uint8_t BITMAP_BatteryLevel2[17] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111110,
|
||||
@ -66,14 +65,13 @@ const uint8_t BITMAP_BatteryLevel2[18] =
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
0b01000001,
|
||||
0b01111111
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_BatteryLevel3[18] =
|
||||
const uint8_t BITMAP_BatteryLevel3[17] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111110,
|
||||
@ -85,7 +83,6 @@ const uint8_t BITMAP_BatteryLevel3[18] =
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
0b01000001,
|
||||
@ -95,7 +92,7 @@ const uint8_t BITMAP_BatteryLevel3[18] =
|
||||
0b01111111
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_BatteryLevel4[18] =
|
||||
const uint8_t BITMAP_BatteryLevel4[17] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111110,
|
||||
@ -104,7 +101,6 @@ const uint8_t BITMAP_BatteryLevel4[18] =
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
0b01000001,
|
||||
@ -117,7 +113,7 @@ const uint8_t BITMAP_BatteryLevel4[18] =
|
||||
0b01111111
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_BatteryLevel5[18] =
|
||||
const uint8_t BITMAP_BatteryLevel5[17] =
|
||||
{
|
||||
0b00000000,
|
||||
0b00111110,
|
||||
@ -125,7 +121,6 @@ const uint8_t BITMAP_BatteryLevel5[18] =
|
||||
0b01000001,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
0b01000001,
|
||||
0b01011101,
|
||||
0b01011101,
|
||||
|
10
bitmaps.h
10
bitmaps.h
@ -6,11 +6,11 @@
|
||||
|
||||
extern const uint8_t BITMAP_PowerSave[8];
|
||||
|
||||
extern const uint8_t BITMAP_BatteryLevel1[18];
|
||||
extern const uint8_t BITMAP_BatteryLevel2[18];
|
||||
extern const uint8_t BITMAP_BatteryLevel3[18];
|
||||
extern const uint8_t BITMAP_BatteryLevel4[18];
|
||||
extern const uint8_t BITMAP_BatteryLevel5[18];
|
||||
extern const uint8_t BITMAP_BatteryLevel1[17];
|
||||
extern const uint8_t BITMAP_BatteryLevel2[17];
|
||||
extern const uint8_t BITMAP_BatteryLevel3[17];
|
||||
extern const uint8_t BITMAP_BatteryLevel4[17];
|
||||
extern const uint8_t BITMAP_BatteryLevel5[17];
|
||||
|
||||
extern const uint8_t BITMAP_USB_C[9];
|
||||
|
||||
|
@ -81,9 +81,26 @@ void BK4819_Init(void)
|
||||
(58u << 4) | // AF Rx Gain-2
|
||||
( 8u << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
|
||||
|
||||
const uint8_t dtmf_coeffs[] = {0x6F,0x6B,0x67,0x62,0x50,0x47,0x3A,0x2C,0x41,0x37,0x25,0x17,0xE4,0xCB,0xB5,0x9F};
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(dtmf_coeffs); i++)
|
||||
BK4819_WriteRegister(BK4819_REG_09, (i << 12) | dtmf_coeffs[i]);
|
||||
// const uint8_t dtmf_coeffs[] = {0x6F,0x6B,0x67,0x62,0x50,0x47,0x3A,0x2C,0x41,0x37,0x25,0x17,0xE4,0xCB,0xB5,0x9F};
|
||||
// for (unsigned int i = 0; i < ARRAY_SIZE(dtmf_coeffs); i++)
|
||||
// BK4819_WriteRegister(BK4819_REG_09, (i << 12) | dtmf_coeffs[i]);
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x006F); // 6F
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x106B); // 6B
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x2067); // 67
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x3062); // 62
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x4050); // 50
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x5046); // 47 **
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x603A); // 3A
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x702C); // 2C
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x8041); // 41
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0x9037); // 37
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xA025); // 25
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xB017); // 17
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xC0E4); // E4
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xD0CB); // CB
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xE0B5); // B5
|
||||
BK4819_WriteRegister(BK4819_REG_09, 0xF09F); // 9F
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_1F, 0x5454);
|
||||
BK4819_WriteRegister(BK4819_REG_3E, 0xA037);
|
||||
@ -687,7 +704,7 @@ void BK4819_RX_TurnOn(void)
|
||||
// Enable DSP
|
||||
// Enable XTAL
|
||||
// Enable Band Gap
|
||||
BK4819_WriteRegister(BK4819_REG_37, 0x1F0F);
|
||||
BK4819_WriteRegister(BK4819_REG_37, 0x1F0F); // 0001111100001111
|
||||
|
||||
// Turn off everything
|
||||
BK4819_WriteRegister(BK4819_REG_30, 0);
|
||||
@ -700,7 +717,7 @@ void BK4819_RX_TurnOn(void)
|
||||
// Disable MIC ADC
|
||||
// Disable TX DSP
|
||||
// Enable RX DSP
|
||||
BK4819_WriteRegister(BK4819_REG_30, 0xBFF1);
|
||||
BK4819_WriteRegister(BK4819_REG_30, 0b1011111111110001); // 1 0 1111 1 1 1111 0 0 0 1
|
||||
}
|
||||
|
||||
void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency)
|
||||
@ -813,8 +830,7 @@ void BK4819_EnableDTMF(void)
|
||||
//
|
||||
BK4819_WriteRegister(BK4819_REG_24,
|
||||
(1u << BK4819_REG_24_SHIFT_UNKNOWN_15)
|
||||
// | (24u << BK4819_REG_24_SHIFT_THRESHOLD) // original
|
||||
| (31u << BK4819_REG_24_SHIFT_THRESHOLD) // hopefully reduced sensitivity
|
||||
| (24u << BK4819_REG_24_SHIFT_THRESHOLD)
|
||||
| (1u << BK4819_REG_24_SHIFT_UNKNOWN_6)
|
||||
| BK4819_REG_24_ENABLE
|
||||
| BK4819_REG_24_SELECT_DTMF
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "driver/st7565.h"
|
||||
#include "driver/system.h"
|
||||
|
||||
#define LCD_WIDTH 128
|
||||
#define LCD_HEIGHT 64
|
||||
|
||||
uint8_t gStatusLine[128];
|
||||
uint8_t gFrameBuffer[7][128];
|
||||
|
||||
|
@ -20,6 +20,9 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define LCD_WIDTH 128
|
||||
#define LCD_HEIGHT 64
|
||||
|
||||
extern uint8_t gStatusLine[128];
|
||||
extern uint8_t gFrameBuffer[7][128];
|
||||
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
40
ui/main.c
40
ui/main.c
@ -35,16 +35,15 @@
|
||||
|
||||
void UI_DisplayMain(void)
|
||||
{
|
||||
const unsigned int display_width = 128;
|
||||
char String[16];
|
||||
unsigned int vfo_num;
|
||||
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
{
|
||||
UI_PrintString("Long press #", 0, display_width - 1, 1, 8);
|
||||
UI_PrintString("to unlock", 0, display_width - 1, 3, 8);
|
||||
{ // tell user how to unlock the keyboard
|
||||
UI_PrintString("Long press #", 0, LCD_WIDTH - 1, 1, 8);
|
||||
UI_PrintString("to unlock", 0, LCD_WIDTH - 1, 3, 8);
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
@ -285,8 +284,7 @@ void UI_DisplayMain(void)
|
||||
break;
|
||||
|
||||
case MDF_NAME: // show the channel name
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 ||
|
||||
gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
{ // no channel name, show the channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
}
|
||||
@ -300,8 +298,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
#ifdef ENABLE_CHAN_NAME_FREQ
|
||||
case MDF_NAME_FREQ: // show the channel name and frequency
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 ||
|
||||
gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
{ // no channel name, show channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
}
|
||||
@ -373,7 +370,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (Level >= 1)
|
||||
{
|
||||
uint8_t *pLine = pLine1 + display_width;
|
||||
uint8_t *pLine = pLine1 + LCD_WIDTH;
|
||||
memmove(pLine + 0, BITMAP_Antenna, sizeof(BITMAP_Antenna));
|
||||
if (Level >= 2)
|
||||
memmove(pLine + 5, BITMAP_AntennaLevel1, sizeof(BITMAP_AntennaLevel1));
|
||||
@ -398,21 +395,21 @@ void UI_DisplayMain(void)
|
||||
strcpy(String, "AM");
|
||||
}
|
||||
else
|
||||
{ // show the CTCSS/DCS symbol
|
||||
{ // or show the CTCSS/DCS symbol
|
||||
const FREQ_Config_t *pConfig = (SomeValue == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX;
|
||||
const unsigned int code_type = pConfig->CodeType;
|
||||
const char *code_list[] = {"", "CT", "DCS", "DCR"};
|
||||
if (code_type >= 0 && code_type < ARRAY_SIZE(code_list))
|
||||
strcpy(String, code_list[code_type]);
|
||||
}
|
||||
UI_PrintStringSmall(String, display_width + 24, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, Line + 1);
|
||||
|
||||
{ // show the TX power
|
||||
const char pwr_list[] = "LMH";
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||
String[0] = (i >= 0 && i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 46, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, Line + 1);
|
||||
}
|
||||
|
||||
if (gEeprom.VfoInfo[vfo_num].ConfigRX.Frequency != gEeprom.VfoInfo[vfo_num].ConfigTX.Frequency)
|
||||
@ -424,31 +421,30 @@ void UI_DisplayMain(void)
|
||||
case TX_OFFSET_FREQUENCY_DIRECTION_SUB: String[0] = '-'; break;
|
||||
}
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 54, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, Line + 1);
|
||||
}
|
||||
|
||||
// show the TX/RX reverse symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
||||
UI_PrintStringSmall("R", display_width + 62, 0, Line + 1);
|
||||
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, Line + 1);
|
||||
|
||||
{ // show the narrow band symbol
|
||||
String[0] = '?';
|
||||
switch (gEeprom.VfoInfo[vfo_num].CHANNEL_BANDWIDTH)
|
||||
String[0] = '\0';
|
||||
if (gEeprom.VfoInfo[vfo_num].CHANNEL_BANDWIDTH == BANDWIDTH_NARROW)
|
||||
{
|
||||
case BANDWIDTH_WIDE: String[0] = '\0'; break;
|
||||
case BANDWIDTH_NARROW: String[0] = 'N'; break;
|
||||
}
|
||||
String[0] = 'N';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 70, 0, Line + 1);
|
||||
}
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, Line + 1);
|
||||
}
|
||||
|
||||
// show the DTMF decoding symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||
UI_PrintStringSmall("DTMF", display_width + 78, 0, Line + 1);
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, Line + 1);
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
UI_PrintStringSmall("SCR", display_width + 106, 0, Line + 1);
|
||||
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, Line + 1);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
|
@ -36,6 +36,9 @@ void UI_UpdateRSSI(uint16_t RSSI)
|
||||
char s[8];
|
||||
const uint8_t line = (gEeprom.RX_CHANNEL == 0) ? 3 : 7;
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
return; // the screen is currently in use
|
||||
|
||||
gVFO_RSSI[gEeprom.RX_CHANNEL] = RSSI;
|
||||
gVFO_RSSI_Level[gEeprom.RX_CHANNEL] = 0;
|
||||
|
||||
@ -58,8 +61,11 @@ void Render(const uint8_t rssi, const uint8_t RssiLevel, const uint8_t VFO)
|
||||
uint8_t *pLine;
|
||||
uint8_t Line;
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
return; // the screen is currently in use
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT || gScreenToDisplay != DISPLAY_MAIN)
|
||||
return;
|
||||
return; // it's still in use
|
||||
|
||||
if (VFO == 0)
|
||||
{
|
||||
|
10
ui/status.c
10
ui/status.c
@ -36,9 +36,9 @@ void UI_DisplayStatus(const bool test_display)
|
||||
|
||||
gUpdateStatus = false;
|
||||
|
||||
memset(line, 0, sizeof(gStatusLine));
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
|
||||
line += 2;
|
||||
// line += 2;
|
||||
|
||||
// POWER-SAVE indicator
|
||||
if (gCurrentFunction == FUNCTION_POWER_SAVE || test_display)
|
||||
@ -109,11 +109,10 @@ void UI_DisplayStatus(const bool test_display)
|
||||
// USB-C charge indicator
|
||||
if (gChargingWithTypeC || test_display)
|
||||
memmove(line, BITMAP_USB_C, sizeof(BITMAP_USB_C));
|
||||
line += sizeof(BITMAP_USB_C);
|
||||
|
||||
line += 4;
|
||||
// line += sizeof(BITMAP_USB_C);
|
||||
|
||||
// BATTERY LEVEL indicator
|
||||
line = gStatusLine + LCD_WIDTH - sizeof(BITMAP_BatteryLevel5); // point to the far right side of the screen
|
||||
if (gBatteryDisplayLevel >= 5 || test_display)
|
||||
memmove(line, BITMAP_BatteryLevel5, sizeof(BITMAP_BatteryLevel5));
|
||||
else
|
||||
@ -128,7 +127,6 @@ void UI_DisplayStatus(const bool test_display)
|
||||
else
|
||||
if (gLowBatteryBlink == 1)
|
||||
memmove(line, BITMAP_BatteryLevel1, sizeof(BITMAP_BatteryLevel1));
|
||||
// line += sizeof(BITMAP_BatteryLevel1);
|
||||
|
||||
ST7565_BlitStatusLine();
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#ifdef GIT_HASH
|
||||
#define VER GIT_HASH
|
||||
#else
|
||||
#define VER "230918"
|
||||
#define VER "230919"
|
||||
#endif
|
||||
|
||||
const char Version[] = "OEFW-"VER;
|
||||
|
@ -21,7 +21,7 @@ del /S /Q *.d >nul 2>nul
|
||||
:: https://github.com/OneOfEleven/k5prog-win
|
||||
::
|
||||
::python -m pip install --upgrade pip crcmod
|
||||
fw-pack.py firmware.bin 230918 firmware.packed.bin
|
||||
fw-pack.py firmware.bin 230919 firmware.packed.bin
|
||||
|
||||
::arm-none-eabi-size firmware
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user