diff --git a/README.md b/README.md index 3946a71..eed3aae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/driver/bk4819.c b/driver/bk4819.c index 78c82a9..044d6bd 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -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)); diff --git a/firmware b/firmware index 89a4104..e1fc53e 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index affc27f..ec905c6 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 47f4d43..04e203f 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/main.c b/main.c index cef6c9e..e03bf3e 100644 --- a/main.c +++ b/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)) { diff --git a/ui/menu.c b/ui/menu.c index d043ec4..320796b 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -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 diff --git a/ui/menu.h b/ui/menu.h index 367f774..cc4257a 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -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;