mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
Radio kill/revive code compile option added
This commit is contained in:
parent
695cf81d17
commit
73572f24b1
4
Makefile
4
Makefile
@ -36,6 +36,7 @@ ENABLE_SHOW_CHARGE_LEVEL := 0
|
||||
ENABLE_REVERSE_BAT_SYMBOL := 1
|
||||
ENABLE_FREQ_SEARCH_TIMEOUT := 0
|
||||
ENABLE_CODE_SEARCH_TIMEOUT := 0
|
||||
ENABLE_KILL_REVIVE := 0
|
||||
ENABLE_AM_FIX := 1
|
||||
ENABLE_AM_FIX_SHOW_DATA := 1
|
||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1
|
||||
@ -328,6 +329,9 @@ endif
|
||||
ifeq ($(ENABLE_CODE_SEARCH_TIMEOUT),1)
|
||||
CFLAGS += -DENABLE_CODE_SEARCH_TIMEOUT
|
||||
endif
|
||||
ifeq ($(ENABLE_KILL_REVIVE),1)
|
||||
CFLAGS += -DENABLE_KILL_REVIVE
|
||||
endif
|
||||
ifeq ($(ENABLE_FREQ_SEARCH_TIMEOUT),1)
|
||||
CFLAGS += -DENABLE_FREQ_SEARCH_TIMEOUT
|
||||
endif
|
||||
|
@ -67,6 +67,7 @@ ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio
|
||||
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
|
||||
ENABLE_FREQ_SEARCH_TIMEOUT := 1 timeout if FREQ not found when using F+4 search function
|
||||
ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function
|
||||
ENABLE_KILL_REVIVE := 0 '1' = include kill and revive code
|
||||
ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation, ignore the on-screen RSSI level (for now)
|
||||
ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still tweaking it)
|
||||
ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
|
||||
|
@ -543,6 +543,11 @@ void AIRCOPY_process_fsk_rx_10ms(void)
|
||||
data[3] = 0xffff;
|
||||
//#endif
|
||||
}
|
||||
else
|
||||
if (eeprom_addr == 0x0F40)
|
||||
{ // killed flag is here
|
||||
data[2] = false; // remove it
|
||||
}
|
||||
|
||||
EEPROM_WriteBuffer(eeprom_addr, data); // 8 bytes at a time
|
||||
data += write_size / sizeof(data[0]);
|
||||
|
23
app/app.c
23
app/app.c
@ -225,7 +225,11 @@ static void APP_process_incoming_rx(void)
|
||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||
{ // not scanning
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_rx_vfo->dtmf_decoding_enable || g_setting_radio_disabled)
|
||||
#else
|
||||
if (g_rx_vfo->dtmf_decoding_enable)
|
||||
#endif
|
||||
{ // DTMF DCD is enabled
|
||||
|
||||
DTMF_HandleRequest();
|
||||
@ -479,8 +483,10 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
||||
const unsigned int chan = g_eeprom.rx_vfo;
|
||||
// const unsigned int chan = g_rx_vfo->channel_save;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_setting_radio_disabled)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
if (g_fm_radio_mode)
|
||||
@ -888,7 +894,11 @@ void APP_process_radio_interrupts(void)
|
||||
g_update_display = true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_rx_vfo->dtmf_decoding_enable || g_setting_radio_disabled)
|
||||
#else
|
||||
if (g_rx_vfo->dtmf_decoding_enable)
|
||||
#endif
|
||||
{
|
||||
if (g_dtmf_rx_index >= (sizeof(g_dtmf_rx) - 1))
|
||||
{ // make room
|
||||
@ -999,8 +1009,10 @@ void APP_end_tx(void)
|
||||
#ifdef ENABLE_VOX
|
||||
static void APP_process_vox(void)
|
||||
{
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_setting_radio_disabled)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (g_vox_resume_count_down == 0)
|
||||
{
|
||||
@ -1350,18 +1362,24 @@ void APP_check_keys(void)
|
||||
|
||||
key_code_t key;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_setting_radio_disabled)
|
||||
return;
|
||||
#endif
|
||||
|
||||
// *****************
|
||||
// PTT is treated completely separately from all the other buttons
|
||||
|
||||
if (ptt_pressed)
|
||||
{ // PTT pressed
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (!g_setting_radio_disabled)
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (!g_setting_radio_disabled && !g_ptt_is_pressed && g_screen_to_display != DISPLAY_AIRCOPY)
|
||||
if (!g_ptt_is_pressed && g_screen_to_display != DISPLAY_AIRCOPY)
|
||||
#else
|
||||
if (!g_setting_radio_disabled && !g_ptt_is_pressed)
|
||||
if (!g_ptt_is_pressed)
|
||||
#endif
|
||||
{
|
||||
if (++g_ptt_debounce >= 3) // 30ms
|
||||
@ -1382,6 +1400,7 @@ void APP_check_keys(void)
|
||||
else
|
||||
g_ptt_debounce = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // PTT released
|
||||
if (g_ptt_is_pressed)
|
||||
|
21
app/dtmf.c
21
app/dtmf.c
@ -215,16 +215,21 @@ void DTMF_HandleRequest(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (!g_rx_vfo->dtmf_decoding_enable && !g_setting_radio_disabled)
|
||||
{ // D-DCD is disabled or we're alive
|
||||
#else
|
||||
if (!g_rx_vfo->dtmf_decoding_enable)
|
||||
#endif
|
||||
{ // D-DCD is disabled or we're enabled
|
||||
DTMF_clear_RX();
|
||||
return;
|
||||
}
|
||||
|
||||
g_dtmf_rx_pending = false;
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_dtmf_rx_index >= 9)
|
||||
{ // look for the KILL code
|
||||
{ // look for the RADIO DISABLE code
|
||||
|
||||
sprintf(String, "%s%c%s", g_eeprom.ani_dtmf_id, g_eeprom.dtmf_separate_code, g_eeprom.kill_code);
|
||||
|
||||
@ -235,7 +240,7 @@ void DTMF_HandleRequest(void)
|
||||
|
||||
if (g_eeprom.permit_remote_kill)
|
||||
{
|
||||
g_setting_radio_disabled = true; // oooerr !
|
||||
g_setting_radio_disabled = true; // :(
|
||||
|
||||
DTMF_clear_RX();
|
||||
|
||||
@ -288,6 +293,7 @@ void DTMF_HandleRequest(void)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_dtmf_rx_index >= 2)
|
||||
{ // look for ACK reply
|
||||
@ -300,7 +306,6 @@ void DTMF_HandleRequest(void)
|
||||
{ // ends with "AB"
|
||||
|
||||
if (g_dtmf_reply_state != DTMF_REPLY_NONE) // 1of11
|
||||
// if (g_dtmf_call_state != DTMF_CALL_STATE_NONE) // 1of11
|
||||
// if (g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT) // 1of11
|
||||
{
|
||||
g_dtmf_state = DTMF_STATE_TX_SUCC;
|
||||
@ -328,10 +333,10 @@ void DTMF_HandleRequest(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (g_setting_radio_disabled || g_dtmf_call_state == DTMF_CALL_STATE_CALL_OUT)
|
||||
{ // we've been disabled, or expecting a reply
|
||||
return;
|
||||
}
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_setting_radio_disabled)
|
||||
return; // we've been disabled
|
||||
#endif
|
||||
|
||||
if (g_dtmf_rx_index >= 7)
|
||||
{ // see if we're being called
|
||||
|
@ -350,6 +350,13 @@ static void cmd_051D(const uint8_t *pBuffer)
|
||||
memset(data, 0xff, 8); // wipe the AES key
|
||||
#endif
|
||||
|
||||
//#ifndef ENABLE_KILL_REVIVE
|
||||
if (Offset == 0x0F40)
|
||||
{ // killed flag is here
|
||||
data[2] = false; // remove it
|
||||
}
|
||||
//#endif
|
||||
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
if ((Offset < 0x0E98 || Offset >= 0x0E9C) || !g_password_locked || pCmd->allow_password)
|
||||
EEPROM_WriteBuffer(Offset, data);
|
||||
|
2
board.c
2
board.c
@ -729,7 +729,9 @@ void BOARD_EEPROM_load(void)
|
||||
g_setting_freq_lock = (Data[0] < 6) ? Data[0] : FREQ_LOCK_NORMAL;
|
||||
#endif
|
||||
g_setting_350_tx_enable = (Data[1] < 2) ? Data[1] : false; // was true
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
g_setting_radio_disabled = (Data[2] < 2) ? Data[2] : false;
|
||||
#endif
|
||||
g_setting_174_tx_enable = (Data[3] < 2) ? Data[3] : false;
|
||||
g_setting_470_tx_enable = (Data[4] < 2) ? Data[4] : false;
|
||||
g_setting_350_enable = (Data[5] < 2) ? Data[5] : true;
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
5
misc.c
5
misc.c
@ -90,8 +90,11 @@ const uint32_t g_default_aes_key[4] = {0x4AA5CC60, 0x0312C
|
||||
|
||||
const uint8_t g_mic_gain_dB_2[5] = {3, 8, 16, 24, 31};
|
||||
|
||||
bool g_setting_350_tx_enable;
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
bool g_setting_radio_disabled;
|
||||
#endif
|
||||
|
||||
bool g_setting_350_tx_enable;
|
||||
bool g_setting_174_tx_enable;
|
||||
bool g_setting_470_tx_enable;
|
||||
bool g_setting_350_enable;
|
||||
|
5
misc.h
5
misc.h
@ -171,8 +171,11 @@ extern const uint16_t scan_pause_7_10ms;
|
||||
|
||||
extern const uint8_t g_mic_gain_dB_2[5];
|
||||
|
||||
extern bool g_setting_350_tx_enable;
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
extern bool g_setting_radio_disabled;
|
||||
#endif
|
||||
|
||||
extern bool g_setting_350_tx_enable;
|
||||
extern bool g_setting_174_tx_enable;
|
||||
extern bool g_setting_470_tx_enable;
|
||||
extern bool g_setting_350_enable;
|
||||
|
4
radio.c
4
radio.c
@ -791,7 +791,11 @@ void RADIO_setup_registers(bool switch_to_function_0)
|
||||
BK4819_SetCompander((g_rx_vfo->am_mode == 0 && g_rx_vfo->compander >= 2) ? g_rx_vfo->compander : 0);
|
||||
|
||||
#if 0
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (!g_rx_vfo->dtmf_decoding_enable && !g_setting_radio_disabled)
|
||||
#else
|
||||
if (!g_rx_vfo->dtmf_decoding_enable)
|
||||
#endif
|
||||
{
|
||||
BK4819_DisableDTMF();
|
||||
}
|
||||
|
@ -310,7 +310,11 @@ void SETTINGS_SaveSettings(void)
|
||||
memset(State, 0xFF, sizeof(State));
|
||||
State[0] = g_setting_freq_lock;
|
||||
State[1] = g_setting_350_tx_enable;
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
State[2] = g_setting_radio_disabled;
|
||||
#else
|
||||
State[2] = false;
|
||||
#endif
|
||||
State[3] = g_setting_174_tx_enable;
|
||||
State[4] = g_setting_470_tx_enable;
|
||||
State[5] = g_setting_350_enable;
|
||||
|
@ -817,8 +817,13 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
|
||||
// show the DTMF decoding symbol
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_eeprom.vfo_info[vfo_num].dtmf_decoding_enable || g_setting_radio_disabled)
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||
#else
|
||||
if (g_eeprom.vfo_info[vfo_num].dtmf_decoding_enable)
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||
#endif
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (g_eeprom.vfo_info[vfo_num].scrambling_type > 0 && g_setting_scramble_enable)
|
||||
|
@ -79,12 +79,15 @@ void UI_DisplayStatus(const bool test_display)
|
||||
// hmmm, what to put in it's place
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KILL_REVIVE
|
||||
if (g_setting_radio_disabled)
|
||||
{
|
||||
memset(line + x, 0xFF, 10);
|
||||
x1 = x + 10;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_FMRADIO
|
||||
// FM indicator
|
||||
if (g_fm_radio_mode || test_display)
|
||||
@ -114,6 +117,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
}
|
||||
x1 = x + 7;
|
||||
}
|
||||
}
|
||||
x += 7; // font character width
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
|
Loading…
x
Reference in New Issue
Block a user