mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
fix step and tx power menus
This commit is contained in:
parent
cfbb5b0bbf
commit
7e5605cd18
@ -1539,7 +1539,7 @@ void APP_process_flash_light_10ms(void)
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
||||
if (!g_squelch_open && !g_monitor_enabled && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||
BK4819_StartTone1(880, 50, true);
|
||||
BK4819_StartTone1(880, 50);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -415,19 +415,16 @@ void MENU_AcceptSetting(void)
|
||||
case MENU_CHAN_SQL:
|
||||
g_tx_vfo->channel.squelch_level = g_sub_menu_selection;
|
||||
g_request_save_channel = 1;
|
||||
g_vfo_configure_mode = VFO_CONFIGURE;
|
||||
return;
|
||||
|
||||
case MENU_STEP:
|
||||
g_tx_vfo->channel.step_setting = step_freq_table_sorted[g_sub_menu_selection];
|
||||
g_request_save_channel = 1;
|
||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||
return;
|
||||
|
||||
case MENU_TX_POWER:
|
||||
g_tx_vfo->channel.tx_power = g_sub_menu_selection;
|
||||
g_request_save_channel = 1;
|
||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||
return;
|
||||
|
||||
case MENU_TX_CDCSS:
|
||||
|
2
audio.c
2
audio.c
@ -173,7 +173,7 @@ void AUDIO_PlayBeep(beep_type_t Beep)
|
||||
}
|
||||
|
||||
// BK4819_PlayTone(ToneFrequency, true);
|
||||
BK4819_StartTone1(ToneFrequency, 96, true);
|
||||
BK4819_StartTone1(ToneFrequency, 96);
|
||||
|
||||
SYSTEM_DelayMs(2);
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
@ -878,7 +878,7 @@ void BK4819_EnableDTMF(void)
|
||||
(15u << BK4819_REG_24_SHIFT_MAX_SYMBOLS)); // 0 ~ 15
|
||||
}
|
||||
|
||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const bool set_dac)
|
||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level)
|
||||
{
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
SYSTEM_DelayMs(2);
|
||||
@ -891,22 +891,12 @@ void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const
|
||||
|
||||
BK4819_WriteRegister(0x70, BK4819_REG_70_ENABLE_TONE1 | ((level & 0x7f) << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN));
|
||||
|
||||
if (set_dac)
|
||||
{
|
||||
BK4819_WriteRegister(0x30, 0);
|
||||
BK4819_WriteRegister(0x30, // all of the following must be enable to get an audio beep ! ???
|
||||
BK4819_REG_30_ENABLE_VCO_CALIB |
|
||||
BK4819_REG_30_ENABLE_UNKNOWN |
|
||||
// BK4819_REG_30_ENABLE_RX_LINK |
|
||||
BK4819_REG_30_ENABLE_AF_DAC | //
|
||||
BK4819_REG_30_ENABLE_DISC_MODE | //
|
||||
BK4819_REG_30_ENABLE_PLL_VCO |
|
||||
BK4819_REG_30_ENABLE_PA_GAIN |
|
||||
// BK4819_REG_30_ENABLE_MIC_ADC |
|
||||
BK4819_REG_30_ENABLE_TX_DSP | //
|
||||
// BK4819_REG_30_ENABLE_RX_DSP |
|
||||
0);
|
||||
}
|
||||
BK4819_REG_30_ENABLE_AF_DAC |
|
||||
BK4819_REG_30_ENABLE_DISC_MODE |
|
||||
BK4819_REG_30_ENABLE_TX_DSP);
|
||||
|
||||
|
||||
BK4819_WriteRegister(0x71, scale_freq(frequency));
|
||||
|
||||
@ -971,7 +961,7 @@ void BK4819_StopTones(const bool tx)
|
||||
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level)
|
||||
{
|
||||
const uint16_t prev_af = BK4819_ReadRegister(0x47);
|
||||
BK4819_StartTone1(tone_Hz, level, true);
|
||||
BK4819_StartTone1(tone_Hz, level);
|
||||
SYSTEM_DelayMs(delay - 2);
|
||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
||||
BK4819_WriteRegister(0x47, prev_af);
|
||||
@ -989,9 +979,9 @@ void BK4819_PlayRoger(void)
|
||||
#endif
|
||||
|
||||
const uint16_t prev_af = BK4819_ReadRegister(0x47);
|
||||
BK4819_StartTone1(tone1_Hz, 96, true);
|
||||
BK4819_StartTone1(tone1_Hz, 96);
|
||||
SYSTEM_DelayMs(80 - 2);
|
||||
BK4819_StartTone1(tone2_Hz, 96, false);
|
||||
BK4819_StartTone1(tone2_Hz, 96);
|
||||
SYSTEM_DelayMs(80);
|
||||
BK4819_StopTones(true);
|
||||
BK4819_WriteRegister(0x47, prev_af);
|
||||
|
@ -103,7 +103,7 @@ void BK4819_SetCompander(const unsigned int mode);
|
||||
void BK4819_DisableVox(void);
|
||||
void BK4819_DisableDTMF(void);
|
||||
void BK4819_EnableDTMF(void);
|
||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const bool set_dac);
|
||||
void BK4819_StartTone1(const uint16_t frequency, const unsigned int level);
|
||||
void BK4819_StopTones(const bool tx);
|
||||
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level);
|
||||
void BK4819_EnterTxMute(void);
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -220,7 +220,7 @@ void FUNCTION_Select(function_type_t Function)
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
SYSTEM_DelayMs(2);
|
||||
BK4819_StartTone1(500, 28, true);
|
||||
BK4819_StartTone1(500, 28);
|
||||
SYSTEM_DelayMs(2);
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
Loading…
x
Reference in New Issue
Block a user