Exit boot screen with any key press + compander update

This commit is contained in:
OneOfEleven 2023-09-16 09:31:20 +01:00
parent 00fe1de467
commit 3793b64373
8 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
main.c
View File

@ -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))
{

View File

@ -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

View File

@ -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;