0
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:
OneOfEleven 2023-11-03 01:26:51 +00:00
parent cfbb5b0bbf
commit 7e5605cd18
9 changed files with 16 additions and 29 deletions

View File

@ -1539,7 +1539,7 @@ void APP_process_flash_light_10ms(void)
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE #ifdef ENABLE_FLASH_LIGHT_SOS_TONE
if (!g_squelch_open && !g_monitor_enabled && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER)) if (!g_squelch_open && !g_monitor_enabled && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
BK4819_StartTone1(880, 50, true); BK4819_StartTone1(880, 50);
#endif #endif
} }
} }

View File

@ -415,19 +415,16 @@ void MENU_AcceptSetting(void)
case MENU_CHAN_SQL: case MENU_CHAN_SQL:
g_tx_vfo->channel.squelch_level = g_sub_menu_selection; g_tx_vfo->channel.squelch_level = g_sub_menu_selection;
g_request_save_channel = 1; g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE;
return; return;
case MENU_STEP: case MENU_STEP:
g_tx_vfo->channel.step_setting = step_freq_table_sorted[g_sub_menu_selection]; g_tx_vfo->channel.step_setting = step_freq_table_sorted[g_sub_menu_selection];
g_request_save_channel = 1; g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
return; return;
case MENU_TX_POWER: case MENU_TX_POWER:
g_tx_vfo->channel.tx_power = g_sub_menu_selection; g_tx_vfo->channel.tx_power = g_sub_menu_selection;
g_request_save_channel = 1; g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
return; return;
case MENU_TX_CDCSS: case MENU_TX_CDCSS:

View File

@ -173,7 +173,7 @@ void AUDIO_PlayBeep(beep_type_t Beep)
} }
// BK4819_PlayTone(ToneFrequency, true); // BK4819_PlayTone(ToneFrequency, true);
BK4819_StartTone1(ToneFrequency, 96, true); BK4819_StartTone1(ToneFrequency, 96);
SYSTEM_DelayMs(2); SYSTEM_DelayMs(2);
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);

View File

@ -878,7 +878,7 @@ void BK4819_EnableDTMF(void)
(15u << BK4819_REG_24_SHIFT_MAX_SYMBOLS)); // 0 ~ 15 (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); GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
SYSTEM_DelayMs(2); 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)); 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_WriteRegister(0x30, 0); BK4819_REG_30_ENABLE_AF_DAC |
BK4819_WriteRegister(0x30, // all of the following must be enable to get an audio beep ! ??? BK4819_REG_30_ENABLE_DISC_MODE |
BK4819_REG_30_ENABLE_VCO_CALIB | BK4819_REG_30_ENABLE_TX_DSP);
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_WriteRegister(0x71, scale_freq(frequency)); 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) void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level)
{ {
const uint16_t prev_af = BK4819_ReadRegister(0x47); const uint16_t prev_af = BK4819_ReadRegister(0x47);
BK4819_StartTone1(tone_Hz, level, true); BK4819_StartTone1(tone_Hz, level);
SYSTEM_DelayMs(delay - 2); SYSTEM_DelayMs(delay - 2);
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT); BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
BK4819_WriteRegister(0x47, prev_af); BK4819_WriteRegister(0x47, prev_af);
@ -989,9 +979,9 @@ void BK4819_PlayRoger(void)
#endif #endif
const uint16_t prev_af = BK4819_ReadRegister(0x47); const uint16_t prev_af = BK4819_ReadRegister(0x47);
BK4819_StartTone1(tone1_Hz, 96, true); BK4819_StartTone1(tone1_Hz, 96);
SYSTEM_DelayMs(80 - 2); SYSTEM_DelayMs(80 - 2);
BK4819_StartTone1(tone2_Hz, 96, false); BK4819_StartTone1(tone2_Hz, 96);
SYSTEM_DelayMs(80); SYSTEM_DelayMs(80);
BK4819_StopTones(true); BK4819_StopTones(true);
BK4819_WriteRegister(0x47, prev_af); BK4819_WriteRegister(0x47, prev_af);

View File

@ -103,7 +103,7 @@ void BK4819_SetCompander(const unsigned int mode);
void BK4819_DisableVox(void); void BK4819_DisableVox(void);
void BK4819_DisableDTMF(void); void BK4819_DisableDTMF(void);
void BK4819_EnableDTMF(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_StopTones(const bool tx);
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level); void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level);
void BK4819_EnterTxMute(void); void BK4819_EnterTxMute(void);

Binary file not shown.

Binary file not shown.

View File

@ -220,7 +220,7 @@ void FUNCTION_Select(function_type_t Function)
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
SYSTEM_DelayMs(2); SYSTEM_DelayMs(2);
BK4819_StartTone1(500, 28, true); BK4819_StartTone1(500, 28);
SYSTEM_DelayMs(2); SYSTEM_DelayMs(2);
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);

View File

@ -446,8 +446,8 @@ void SETTINGS_save(void)
void SETTINGS_save_channel(const unsigned int channel, const unsigned int vfo, vfo_info_t *p_vfo, const unsigned int mode) void SETTINGS_save_channel(const unsigned int channel, const unsigned int vfo, vfo_info_t *p_vfo, const unsigned int mode)
{ {
const unsigned int chan = CHANNEL_NUM(channel, vfo); const unsigned int chan = CHANNEL_NUM(channel, vfo);
t_channel *p_channel = &g_eeprom.config.channel[chan]; t_channel *p_channel = &g_eeprom.config.channel[chan];
unsigned int eeprom_addr = chan * 16; unsigned int eeprom_addr = chan * 16;
if (IS_NOAA_CHANNEL(channel)) if (IS_NOAA_CHANNEL(channel))