mirror of
https://github.com/egzumer/uv-k5-firmware-custom
synced 2024-11-22 01:32:43 +00:00
Exit boot screen with any key press + compander update
This commit is contained in:
parent
00fe1de467
commit
3793b64373
@ -4,7 +4,7 @@ This repository is a cloned and customized version of DualTachyon's open firmwar
|
||||
|
||||
https://github.com/DualTachyon/uv-k5-firmware
|
||||
|
||||
A cool achievement if you ask me
|
||||
A cool achievement
|
||||
|
||||
# User customization
|
||||
|
||||
|
@ -528,6 +528,11 @@ void BK4819_SetCompander(const unsigned int mode)
|
||||
{
|
||||
uint16_t val;
|
||||
|
||||
// mode 0 .. OFF
|
||||
// mode 1 .. TX
|
||||
// mode 2 .. RX
|
||||
// mode 3 .. TX and RX
|
||||
|
||||
if (mode == 0)
|
||||
{ // disable
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
@ -536,7 +541,6 @@ void BK4819_SetCompander(const unsigned int mode)
|
||||
}
|
||||
|
||||
// enable
|
||||
|
||||
val = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, val | (1u < 3));
|
||||
|
||||
@ -548,8 +552,7 @@ void BK4819_SetCompander(const unsigned int mode)
|
||||
// 10 = 2:1
|
||||
// 11 = 4:1
|
||||
//
|
||||
// const uint16_t compress_ratio = (mode >= 1) ? 2 : 0; // 2:1
|
||||
const uint16_t compress_ratio = (mode >= 1) ? 3 : 0; // 4:1
|
||||
const uint16_t compress_ratio = (mode == 1 || mode >= 3) ? 3 : 0; // 4:1
|
||||
val = BK4819_ReadRegister(BK4819_REG_29);
|
||||
BK4819_WriteRegister(BK4819_REG_29, (val & ~(3u < 14)) | (compress_ratio < 14));
|
||||
|
||||
@ -561,7 +564,6 @@ void BK4819_SetCompander(const unsigned int mode)
|
||||
// 10 = 1:3
|
||||
// 11 = 1:4
|
||||
//
|
||||
// const uint16_t expand_ratio = (mode >= 2) ? 1 : 0; // 1:2
|
||||
const uint16_t expand_ratio = (mode >= 2) ? 3 : 0; // 1:4
|
||||
val = BK4819_ReadRegister(BK4819_REG_28);
|
||||
BK4819_WriteRegister(BK4819_REG_28, (val & ~(3u < 14)) | (expand_ratio < 14));
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
15
main.c
15
main.c
@ -66,7 +66,7 @@ void Main(void)
|
||||
SYSTICK_Init();
|
||||
BOARD_Init();
|
||||
UART_Init();
|
||||
|
||||
|
||||
UART_Send(UART_Version, strlen(UART_Version));
|
||||
|
||||
// Not implementing authentic device checks
|
||||
@ -93,11 +93,11 @@ void Main(void)
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(gBatteryVoltages); i++)
|
||||
BOARD_ADC_GetBatteryInfo(&gBatteryVoltages[i], &gBatteryCurrent);
|
||||
|
||||
|
||||
BATTERY_GetReadings(false);
|
||||
|
||||
gMenuListCount = 0;
|
||||
|
||||
|
||||
if (!gChargingWithTypeC && !gBatteryDisplayLevel)
|
||||
{
|
||||
FUNCTION_Select(FUNCTION_POWER_SAVE);
|
||||
@ -124,15 +124,16 @@ void Main(void)
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
|
||||
{ // 2.55 second boot-up screen
|
||||
while (boot_counter < 255)
|
||||
while (boot_counter < 255 && KEYBOARD_Poll() == KEY_INVALID)
|
||||
{
|
||||
#ifdef ENABLE_BOOT_BEEPS
|
||||
if ((boot_counter % 25) == 0)
|
||||
AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
|
||||
#endif
|
||||
}
|
||||
//boot_counter = 255; // halt boot beeps
|
||||
}
|
||||
|
||||
|
||||
BootMode = BOOT_GetMode();
|
||||
|
||||
if (gEeprom.POWER_ON_PASSWORD < 1000000)
|
||||
@ -151,9 +152,9 @@ void Main(void)
|
||||
#ifdef ENABLE_VOICE
|
||||
{
|
||||
uint8_t Channel;
|
||||
|
||||
|
||||
AUDIO_SetVoiceID(0, VOICE_ID_WELCOME);
|
||||
|
||||
|
||||
Channel = gEeprom.ScreenChannel[gEeprom.TX_CHANNEL];
|
||||
if (IS_MR_CHANNEL(Channel))
|
||||
{
|
||||
|
@ -246,10 +246,11 @@ const char gSubMenu_F_LOCK[6][4] =
|
||||
};
|
||||
|
||||
#ifdef ENABLE_COMPANDER
|
||||
const char gSubMenu_Compand[3][6] =
|
||||
const char gSubMenu_Compand[4][6] =
|
||||
{
|
||||
"OFF",
|
||||
"TX",
|
||||
"RX",
|
||||
"TX/RX"
|
||||
};
|
||||
#endif
|
||||
|
@ -122,7 +122,7 @@ extern const char gSubMenu_ROGER[3][6];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
extern const char gSubMenu_F_LOCK[6][4];
|
||||
#ifdef ENABLE_COMPANDER
|
||||
extern const char gSubMenu_Compand[3][6];
|
||||
extern const char gSubMenu_Compand[4][6];
|
||||
#endif
|
||||
|
||||
extern bool gIsInSubMenu;
|
||||
|
Loading…
Reference in New Issue
Block a user