0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Fixed keypad-5 noaa bug

This commit is contained in:
OneOfEleven 2023-09-15 22:48:06 +01:00
parent eb7dcceaab
commit 540906cc3f
12 changed files with 47 additions and 26 deletions

View File

@ -36,11 +36,12 @@ To enable the custom option, set the above option to '1'
# Some other changes made # Some other changes made
* Various bugs fixed that the QS firmware had * Various original QS firmware bugs fixed
* Added new bugs * Added new bugs
* Finer RSSI bar steps * Finer RSSI bar steps
* Nicer/cleaner big numeric font than original QS big numeric font * Nicer/cleaner big numeric font than original QS big numeric font
* Various menu re-wordings - trying to reduce 'WTH does that mean ?' * Various menu re-wordings - trying to reduce 'WTH does that mean ?'
* Extra menu items (including hidden menu freq calibration)
* plus others * plus others
# Compiler # Compiler

View File

@ -475,9 +475,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step) void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
{ {
uint32_t Frequency; uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
if (pInfo->StepFrequency == 833) if (pInfo->StepFrequency == 833)
{ {
@ -493,12 +491,12 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
} }
if (Frequency > UpperLimitFrequencyBandTable[pInfo->Band]) if (Frequency > UpperLimitFrequencyBandTable[pInfo->Band])
pInfo->ConfigRX.Frequency = LowerLimitFrequencyBandTable[pInfo->Band]; Frequency = LowerLimitFrequencyBandTable[pInfo->Band];
else else
if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band]) if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band])
pInfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]); Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]);
else
pInfo->ConfigRX.Frequency = Frequency; pInfo->ConfigRX.Frequency = Frequency;
} }
static void FREQ_NextChannel(void) static void FREQ_NextChannel(void)
@ -1201,7 +1199,7 @@ void APP_TimeSlice10ms(void)
#ifdef ENABLE_BOOT_BEEPS #ifdef ENABLE_BOOT_BEEPS
if (boot_counter < 255) if (boot_counter < 255)
if ((boot_counter % 25) == 0) if ((boot_counter % 25) == 0)
AUDIO_PlayBeep(BEEP_440HZ_40MS_OPTIONAL); AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif #endif
if (UART_IsCommandAvailable()) if (UART_IsCommandAvailable())

View File

@ -161,8 +161,6 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
break; break;
case KEY_5: case KEY_5:
// TODO: something wrong here !!
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
{ {
@ -175,16 +173,9 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE; gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
#endif #endif
} }
#else gRequestSaveVFO = true;
//gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL]; gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
gEeprom.ScreenChannel[Vfo] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL];
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
#endif
#endif #endif
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
break; break;
case KEY_6: case KEY_6:

View File

@ -123,6 +123,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
case BEEP_440HZ_500MS: case BEEP_440HZ_500MS:
ToneFrequency = 440; ToneFrequency = 440;
break; break;
case BEEP_880HZ_40MS_OPTIONAL:
ToneFrequency = 880;
break;
} }
BK4819_PlayTone(ToneFrequency, true); BK4819_PlayTone(ToneFrequency, true);
@ -149,6 +152,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
Duration = 60; Duration = 60;
break; break;
case BEEP_880HZ_40MS_OPTIONAL:
case BEEP_440HZ_40MS_OPTIONAL: case BEEP_440HZ_40MS_OPTIONAL:
BK4819_ExitTxMute(); BK4819_ExitTxMute();
Duration = 40; Duration = 40;

View File

@ -27,7 +27,8 @@ enum BEEP_Type_t
BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL, BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL,
BEEP_440HZ_500MS, BEEP_440HZ_500MS,
BEEP_500HZ_60MS_DOUBLE_BEEP, BEEP_500HZ_60MS_DOUBLE_BEEP,
BEEP_440HZ_40MS_OPTIONAL BEEP_440HZ_40MS_OPTIONAL,
BEEP_880HZ_40MS_OPTIONAL
}; };
typedef enum BEEP_Type_t BEEP_Type_t; typedef enum BEEP_Type_t BEEP_Type_t;

View File

@ -532,8 +532,34 @@ void BK4819_DisableCompander(void)
void BK4819_EnableCompander(void) void BK4819_EnableCompander(void)
{ {
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31); uint16_t val;
BK4819_WriteRegister(BK4819_REG_31, Value | (1u < 3));
val = BK4819_ReadRegister(BK4819_REG_31);
BK4819_WriteRegister(BK4819_REG_31, val | (1u < 3));
// set the compressor ratio
//
// REG_29 <15:14> 10 Compress (AF Tx) Ratio
// 00 = Disable
// 01 = 1.333:1
// 10 = 2:1
// 11 = 4:1
//
const uint16_t compress_ratio = 2; // 2:1
val = BK4819_ReadRegister(BK4819_REG_29);
BK4819_WriteRegister(BK4819_REG_29, (val & ~(3u < 14)) | (compress_ratio < 14));
// set the expander ratio
//
// REG_28 <15:14> 01 Expander (AF Rx) Ratio
// 00 = Disable
// 01 = 1:2
// 10 = 1:3
// 11 = 1:4
//
const uint16_t expand_ratio = 1; // 2:1
val = BK4819_ReadRegister(BK4819_REG_28);
BK4819_WriteRegister(BK4819_REG_28, (val & ~(3u < 14)) | (expand_ratio < 14));
} }
void BK4819_DisableVox(void) void BK4819_DisableVox(void)

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
main.c
View File

@ -128,7 +128,7 @@ void Main(void)
{ {
#ifdef ENABLE_BOOT_BEEPS #ifdef ENABLE_BOOT_BEEPS
if ((boot_counter % 25) == 0) if ((boot_counter % 25) == 0)
AUDIO_PlayBeep(BEEP_440HZ_40MS_OPTIONAL); AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif #endif
} }
} }

View File

@ -2,7 +2,7 @@
#ifdef GIT_HASH #ifdef GIT_HASH
#define VER GIT_HASH #define VER GIT_HASH
#else #else
#define VER "230915" #define VER "230916"
#endif #endif
const char Version[] = "OEFW-"VER; const char Version[] = "OEFW-"VER;

View File

@ -13,7 +13,7 @@ del /S /Q *.o >nul 2>nul
del /S /Q *.d >nul 2>nul del /S /Q *.d >nul 2>nul
::python -m pip install --upgrade pip crcmod ::python -m pip install --upgrade pip crcmod
fw-pack.py firmware.bin 230915 firmware.packed.bin fw-pack.py firmware.bin 230916 firmware.packed.bin
::arm-none-eabi-size firmware ::arm-none-eabi-size firmware