mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-30 15:21:26 +03:00
updates
This commit is contained in:
parent
f3e347bc5a
commit
dac0cc0d18
24
Makefile
24
Makefile
@ -30,7 +30,7 @@ ENABLE_MUTE_RADIO_FOR_VOICE := 0
|
|||||||
# Tx on Voice 1.0 kB
|
# Tx on Voice 1.0 kB
|
||||||
ENABLE_VOX := 0
|
ENABLE_VOX := 0
|
||||||
ENABLE_REDUCE_LOW_MID_TX_POWER := 1
|
ENABLE_REDUCE_LOW_MID_TX_POWER := 1
|
||||||
# Tx Alarm 0.6 kB
|
# Tx Alarm 600 B
|
||||||
ENABLE_ALARM := 0
|
ENABLE_ALARM := 0
|
||||||
ENABLE_TX1750 := 1
|
ENABLE_TX1750 := 1
|
||||||
# MDC1200 2.8 kB
|
# MDC1200 2.8 kB
|
||||||
@ -42,12 +42,12 @@ ENABLE_BIG_FREQ := 0
|
|||||||
ENABLE_SMALL_BOLD := 1
|
ENABLE_SMALL_BOLD := 1
|
||||||
# smallest font 2 kB
|
# smallest font 2 kB
|
||||||
ENABLE_SMALLEST_FONT := 0
|
ENABLE_SMALLEST_FONT := 0
|
||||||
# trim trailing 0.044 kB
|
# trim trailing 44 B
|
||||||
ENABLE_TRIM_TRAILING_ZEROS := 1
|
ENABLE_TRIM_TRAILING_ZEROS := 1
|
||||||
ENABLE_KEEP_MEM_NAME := 1
|
ENABLE_KEEP_MEM_NAME := 1
|
||||||
ENABLE_WIDE_RX := 1
|
ENABLE_WIDE_RX := 1
|
||||||
ENABLE_TX_WHEN_AM := 0
|
ENABLE_TX_WHEN_AM := 0
|
||||||
# Freq calibration 0.188 kB
|
# Freq calibration 188 B
|
||||||
ENABLE_F_CAL_MENU := 0
|
ENABLE_F_CAL_MENU := 0
|
||||||
ENABLE_TX_UNLOCK := 0
|
ENABLE_TX_UNLOCK := 0
|
||||||
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
|
||||||
@ -59,25 +59,25 @@ ENABLE_SHOW_CHARGE_LEVEL := 0
|
|||||||
ENABLE_REVERSE_BAT_SYMBOL := 1
|
ENABLE_REVERSE_BAT_SYMBOL := 1
|
||||||
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
||||||
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
||||||
# Kill and Revive 0.4 kB
|
# Kill and Revive 400 B
|
||||||
ENABLE_KILL_REVIVE := 0
|
ENABLE_KILL_REVIVE := 0
|
||||||
# AM Fix 0.8 kB
|
# AM Fix 800 B
|
||||||
ENABLE_AM_FIX := 1
|
ENABLE_AM_FIX := 1
|
||||||
ENABLE_AM_FIX_SHOW_DATA := 0
|
ENABLE_AM_FIX_SHOW_DATA := 0
|
||||||
# Squelch 0.012 kB .. can't be right ?
|
# Squelch 12 B .. can't be right ?
|
||||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1
|
ENABLE_SQUELCH_MORE_SENSITIVE := 1
|
||||||
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1
|
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1
|
||||||
ENABLE_FASTER_CHANNEL_SCAN := 1
|
ENABLE_FASTER_CHANNEL_SCAN := 1
|
||||||
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1
|
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1
|
||||||
# Rx Signal Bar 0.4 kB
|
# Rx Signal Bar 400 B
|
||||||
ENABLE_RX_SIGNAL_BAR := 0
|
ENABLE_RX_SIGNAL_BAR := 1
|
||||||
# Tx Timeout Bar 0.2 kB
|
# Tx Timeout Bar 200 B
|
||||||
ENABLE_TX_TIMEOUT_BAR := 0
|
ENABLE_TX_TIMEOUT_BAR := 0
|
||||||
# Tx Audio Bar 0.3 kB
|
# Tx Audio Bar 300 B
|
||||||
ENABLE_TX_AUDIO_BAR := 1
|
ENABLE_TX_AUDIO_BAR := 1
|
||||||
# Side Button Menu 0.3 kB
|
# Side Button Menu 300 B
|
||||||
ENABLE_SIDE_BUTT_MENU := 1
|
ENABLE_SIDE_BUTT_MENU := 1
|
||||||
# Key Lock 0.4 kB
|
# Key Lock 400 B
|
||||||
ENABLE_KEYLOCK := 0
|
ENABLE_KEYLOCK := 0
|
||||||
#ENABLE_PANADAPTER := 0
|
#ENABLE_PANADAPTER := 0
|
||||||
#ENABLE_SINGLE_VFO_CHAN := 0
|
#ENABLE_SINGLE_VFO_CHAN := 0
|
||||||
|
@ -99,10 +99,11 @@ void ACTION_Monitor(void)
|
|||||||
if (!g_monitor_enabled) // (g_current_function != FUNCTION_MONITOR)
|
if (!g_monitor_enabled) // (g_current_function != FUNCTION_MONITOR)
|
||||||
{ // enable monitor mode
|
{ // enable monitor mode
|
||||||
|
|
||||||
|
g_monitor_enabled = true;
|
||||||
g_beep_to_play = BEEP_NONE;
|
g_beep_to_play = BEEP_NONE;
|
||||||
|
|
||||||
g_monitor_enabled = true;
|
if (!g_squelch_open && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||||
// g_squelch_open = true;
|
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
// if (g_rx_vfo->channel_save >= NOAA_CHANNEL_FIRST && g_is_noaa_mode)
|
// if (g_rx_vfo->channel_save >= NOAA_CHANNEL_FIRST && g_is_noaa_mode)
|
||||||
|
43
app/app.c
43
app/app.c
@ -95,6 +95,7 @@ static void APP_update_rssi(const int vfo)
|
|||||||
|
|
||||||
g_current_rssi[vfo] = rssi;
|
g_current_rssi[vfo] = rssi;
|
||||||
|
|
||||||
|
if (g_squelch_open)
|
||||||
UI_update_rssi(rssi, vfo);
|
UI_update_rssi(rssi, vfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,6 +167,7 @@ done:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
APP_update_rssi(g_eeprom.rx_vfo);
|
APP_update_rssi(g_eeprom.rx_vfo);
|
||||||
|
|
||||||
g_update_rssi = true;
|
g_update_rssi = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,10 +493,12 @@ bool APP_start_listening(void)
|
|||||||
g_scan_pause_time_mode = true;
|
g_scan_pause_time_mode = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_CARRIER:
|
case SCAN_RESUME_CARRIER:
|
||||||
g_scan_pause_tick_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
g_scan_pause_tick_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_scan_pause_time_mode = false;
|
g_scan_pause_time_mode = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_STOP:
|
case SCAN_RESUME_STOP:
|
||||||
g_scan_pause_tick_10ms = 0;
|
g_scan_pause_tick_10ms = 0;
|
||||||
g_scan_pause_time_mode = false;
|
g_scan_pause_time_mode = false;
|
||||||
@ -524,16 +528,15 @@ bool APP_start_listening(void)
|
|||||||
|
|
||||||
g_dual_watch_tick_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
g_dual_watch_tick_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_rx_vfo_is_active = true;
|
g_rx_vfo_is_active = true;
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AF gain - original QS values
|
// AF gain - original QS values
|
||||||
if (g_rx_vfo->am_mode)
|
// if (g_rx_vfo->am_mode)
|
||||||
{
|
// {
|
||||||
BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
|
// BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
{
|
||||||
BK4819_WriteRegister(0x48,
|
BK4819_WriteRegister(0x48,
|
||||||
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
||||||
@ -977,13 +980,14 @@ void APP_process_radio_interrupts(void)
|
|||||||
if (interrupt_bits & BK4819_REG_02_SQUELCH_CLOSED)
|
if (interrupt_bits & BK4819_REG_02_SQUELCH_CLOSED)
|
||||||
{
|
{
|
||||||
g_squelch_open = false;
|
g_squelch_open = false;
|
||||||
// g_squelch_open = g_monitor_enabled;
|
|
||||||
|
|
||||||
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, false); // LED off
|
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, false); // LED off
|
||||||
|
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
UART_SendText("sq close\r\n");
|
UART_SendText("sq close\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_update_display = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interrupt_bits & BK4819_REG_02_SQUELCH_OPENED)
|
if (interrupt_bits & BK4819_REG_02_SQUELCH_OPENED)
|
||||||
@ -993,6 +997,11 @@ void APP_process_radio_interrupts(void)
|
|||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
UART_SendText("sq open\r\n");
|
UART_SendText("sq open\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (g_monitor_enabled)
|
||||||
|
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_GREEN, true); // LED on
|
||||||
|
|
||||||
|
g_update_display = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1003,28 +1012,28 @@ void APP_end_tx(void)
|
|||||||
RADIO_tx_eot();
|
RADIO_tx_eot();
|
||||||
|
|
||||||
if (g_current_vfo->p_tx->code_type != CODE_TYPE_NONE)
|
if (g_current_vfo->p_tx->code_type != CODE_TYPE_NONE)
|
||||||
{ // CTCSS/DCS is enabled
|
{ // CTCSS/CDCSS is enabled
|
||||||
|
|
||||||
//if (g_eeprom.tail_note_elimination && g_eeprom.repeater_tail_tone_elimination > 0)
|
//if (g_eeprom.tail_note_elimination && g_eeprom.repeater_tail_tone_elimination > 0)
|
||||||
if (g_eeprom.tail_note_elimination)
|
if (g_eeprom.tail_note_elimination)
|
||||||
{ // send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash
|
{ // send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash
|
||||||
RADIO_EnableCxCSS();
|
RADIO_EnableCxCSS();
|
||||||
}
|
}
|
||||||
#if 0
|
#if 1
|
||||||
else
|
else
|
||||||
{ // TX a short blank carrier
|
{ // TX a short blank carrier after disabling the CTCSS/CDCSS
|
||||||
// this gives the receivers time to mute RX audio before we drop carrier
|
// this gives the receivers time to mute their RX audio before we drop carrier
|
||||||
BK4819_ExitSubAu();
|
BK4819_ExitSubAu();
|
||||||
SYSTEM_DelayMs(200);
|
SYSTEM_DelayMs(200);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_speaker_enabled = false;
|
||||||
|
|
||||||
RADIO_setup_registers(false);
|
RADIO_setup_registers(false);
|
||||||
|
|
||||||
if (!g_speaker_enabled && !g_monitor_enabled)
|
if (g_monitor_enabled)
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
|
||||||
else
|
|
||||||
APP_start_listening();
|
APP_start_listening();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1458,7 +1467,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, 127, true);
|
BK4819_StartTone1(880, 50, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1468,7 +1477,7 @@ void APP_process_flash_light_10ms(void)
|
|||||||
{ // LED off
|
{ // LED off
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF
|
||||||
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
#ifdef ENABLE_FLASH_LIGHT_SOS_TONE
|
||||||
if (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
if (!g_squelch_open && !g_monitor_enabled && GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER))
|
||||||
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
BK4819_StopTones(g_current_function == FUNCTION_TRANSMIT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2530,9 +2539,7 @@ void APP_time_slice_10ms(void)
|
|||||||
|
|
||||||
if (g_vox_pause_tick_10ms > 0)
|
if (g_vox_pause_tick_10ms > 0)
|
||||||
g_vox_pause_tick_10ms--;
|
g_vox_pause_tick_10ms--;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_VOX
|
|
||||||
if (g_eeprom.vox_switch)
|
if (g_eeprom.vox_switch)
|
||||||
APP_process_vox();
|
APP_process_vox();
|
||||||
#endif
|
#endif
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
9
radio.c
9
radio.c
@ -695,12 +695,11 @@ void RADIO_setup_registers(bool switch_to_function_foreground)
|
|||||||
BK4819_set_GPIO_pin(BK4819_GPIO0_PIN28_RX_ENABLE, true);
|
BK4819_set_GPIO_pin(BK4819_GPIO0_PIN28_RX_ENABLE, true);
|
||||||
|
|
||||||
// AF RX Gain and DAC
|
// AF RX Gain and DAC
|
||||||
|
// if (g_rx_vfo->am_mode)
|
||||||
|
// {
|
||||||
// BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
|
// BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
|
||||||
if (g_rx_vfo->am_mode)
|
// }
|
||||||
{
|
// else
|
||||||
BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
BK4819_WriteRegister(0x48,
|
BK4819_WriteRegister(0x48,
|
||||||
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
||||||
|
@ -587,8 +587,7 @@ void UI_DisplayMain(void)
|
|||||||
else
|
else
|
||||||
{ // receiving .. show the RX symbol
|
{ // receiving .. show the RX symbol
|
||||||
mode = 2;
|
mode = 2;
|
||||||
if ((g_current_function == FUNCTION_RECEIVE || g_current_function == FUNCTION_NEW_RECEIVE) &&
|
if ((g_current_function == FUNCTION_RECEIVE && g_squelch_open) && g_eeprom.rx_vfo == vfo_num)
|
||||||
g_eeprom.rx_vfo == vfo_num)
|
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
#ifdef ENABLE_SMALL_BOLD
|
||||||
UI_PrintStringSmallBold("RX", 14, 0, line);
|
UI_PrintStringSmallBold("RX", 14, 0, line);
|
||||||
@ -829,11 +828,8 @@ void UI_DisplayMain(void)
|
|||||||
else
|
else
|
||||||
if (mode == 2)
|
if (mode == 2)
|
||||||
{ // RX signal level
|
{ // RX signal level
|
||||||
//#ifndef ENABLE_RX_SIGNAL_BAR
|
|
||||||
// antenna bar graph
|
|
||||||
if (g_vfo_rssi_bar_level[vfo_num] > 0)
|
if (g_vfo_rssi_bar_level[vfo_num] > 0)
|
||||||
Level = g_vfo_rssi_bar_level[vfo_num];
|
Level = g_vfo_rssi_bar_level[vfo_num];
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_drawBars(p_line1 + LCD_WIDTH, Level);
|
UI_drawBars(p_line1 + LCD_WIDTH, Level);
|
||||||
@ -917,7 +913,7 @@ void UI_DisplayMain(void)
|
|||||||
g_dtmf_call_state == DTMF_CALL_STATE_NONE)
|
g_dtmf_call_state == DTMF_CALL_STATE_NONE)
|
||||||
{ // we're free to use the middle line
|
{ // we're free to use the middle line
|
||||||
|
|
||||||
const bool rx = (g_current_function == FUNCTION_RECEIVE);
|
const bool rx = (g_current_function == FUNCTION_RECEIVE && g_squelch_open) ? true : false;
|
||||||
|
|
||||||
#ifdef ENABLE_TX_TIMEOUT_BAR
|
#ifdef ENABLE_TX_TIMEOUT_BAR
|
||||||
// show the TX timeout count down
|
// show the TX timeout count down
|
||||||
|
Loading…
x
Reference in New Issue
Block a user