mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 06:11:24 +03:00
fix dtmf tx
This commit is contained in:
parent
c68bff681e
commit
34c80a6805
33
app/dtmf.c
33
app/dtmf.c
@ -24,6 +24,9 @@
|
||||
#include "driver/eeprom.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/system.h"
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
#include "driver/uart.h"
|
||||
#endif
|
||||
#include "dtmf.h"
|
||||
#include "external/printf/printf.h"
|
||||
#include "misc.h"
|
||||
@ -326,7 +329,7 @@ void DTMF_HandleRequest(void)
|
||||
|
||||
if (DTMF_CompareMessage(g_dtmf_rx + Offset, String, strlen(String), false))
|
||||
{ // we got a response
|
||||
g_dtmf_state = DTMF_STATE_CALL_OUT_RSP;
|
||||
g_dtmf_state = DTMF_STATE_CALL_OUT_RSP;
|
||||
DTMF_clear_RX();
|
||||
g_update_display = true;
|
||||
}
|
||||
@ -390,7 +393,7 @@ bool DTMF_Reply(void)
|
||||
{
|
||||
const uint16_t delay_ms = ((g_eeprom.config.setting.dtmf.preload_time < 15) ? 15 : g_eeprom.config.setting.dtmf.preload_time) * 10;
|
||||
const char *pString = NULL;
|
||||
char String[23];
|
||||
char str[23];
|
||||
|
||||
switch (g_dtmf_reply_state)
|
||||
{
|
||||
@ -401,9 +404,14 @@ bool DTMF_Reply(void)
|
||||
}
|
||||
else
|
||||
{ // append our ID code onto the end of the DTMF code to send
|
||||
sprintf(String, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.ani_id);
|
||||
pString = String;
|
||||
sprintf(str, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.ani_id);
|
||||
pString = str;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("dtmf tx reply ani %s\r\n", pString);
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
case DTMF_REPLY_AB:
|
||||
@ -411,13 +419,18 @@ bool DTMF_Reply(void)
|
||||
break;
|
||||
|
||||
case DTMF_REPLY_AAAAA:
|
||||
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
||||
pString = String;
|
||||
sprintf(str, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
||||
pString = str;
|
||||
break;
|
||||
|
||||
default:
|
||||
case DTMF_REPLY_NONE:
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("dtmf tx reply none %s\r\n", g_dtmf_string);
|
||||
#endif
|
||||
|
||||
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO ||
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
|
||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN)
|
||||
@ -449,9 +462,9 @@ bool DTMF_Reply(void)
|
||||
pString,
|
||||
1,
|
||||
g_eeprom.config.setting.dtmf.first_code_persist_time * 10,
|
||||
g_eeprom.config.setting.dtmf.hash_code_persist_time * 10,
|
||||
g_eeprom.config.setting.dtmf.code_persist_time * 10,
|
||||
g_eeprom.config.setting.dtmf.code_interval_time * 10);
|
||||
g_eeprom.config.setting.dtmf.hash_code_persist_time * 10,
|
||||
g_eeprom.config.setting.dtmf.code_persist_time * 10,
|
||||
g_eeprom.config.setting.dtmf.code_interval_time * 10);
|
||||
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
|
||||
|
@ -209,7 +209,7 @@ void GENERIC_Key_PTT(bool key_pressed)
|
||||
if (g_dtmf_input_box_index < sizeof(g_dtmf_input_box))
|
||||
g_dtmf_input_box[g_dtmf_input_box_index] = 0; // NULL term the string
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
// append our DTMF ID to the inputted DTMF code -
|
||||
// IF the user inputted code is exactly 3 digits long
|
||||
if (g_dtmf_input_box_index == 3)
|
||||
@ -231,6 +231,10 @@ void GENERIC_Key_PTT(bool key_pressed)
|
||||
|
||||
g_dtmf_reply_state = DTMF_REPLY_ANI;
|
||||
g_dtmf_state = DTMF_STATE_0;
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("generic ptt tx %s\r\n", g_dtmf_string);
|
||||
#endif
|
||||
}
|
||||
|
||||
DTMF_clear_input_box();
|
||||
|
@ -363,6 +363,7 @@ void processFKeyFunction(const key_code_t Key)
|
||||
#ifdef ENABLE_PANADAPTER
|
||||
if (g_fkey_pressed)
|
||||
{
|
||||
g_fkey_pressed = false;
|
||||
g_eeprom.config.setting.panadapter = (g_eeprom.config.setting.panadapter + 1) & 1u;
|
||||
g_request_save_settings = true;
|
||||
break;
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -179,8 +179,7 @@ void FUNCTION_Select(function_type_t Function)
|
||||
g_tx_timeout_reached = false;
|
||||
g_flag_end_tx = false;
|
||||
|
||||
g_rtte_count_down = 0;
|
||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
||||
g_rtte_count_down = 0;
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (g_alarm_state == ALARM_STATE_OFF)
|
||||
@ -234,6 +233,10 @@ void FUNCTION_Select(function_type_t Function)
|
||||
|
||||
RADIO_enableTX(false);
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
// UART_printf("function tx %u %s\r\n", g_dtmf_reply_state, g_dtmf_string);
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||
if (g_alarm_state != ALARM_STATE_OFF)
|
||||
{
|
||||
|
14
radio.c
14
radio.c
@ -1085,9 +1085,9 @@ void RADIO_PrepareTX(void)
|
||||
else
|
||||
if (g_battery_display_level == 0)
|
||||
State = VFO_STATE_BAT_LOW; // charge your battery !
|
||||
else
|
||||
if (g_battery_display_level >= 6)
|
||||
State = VFO_STATE_VOLTAGE_HIGH; // over voltage (no doubt to protect the PA) .. this is being a pain
|
||||
// else
|
||||
// if (g_battery_display_level >= 6)
|
||||
// State = VFO_STATE_VOLTAGE_HIGH; // over voltage (no doubt to protect the PA) .. this is being a pain
|
||||
}
|
||||
else
|
||||
State = VFO_STATE_TX_DISABLE; // TX frequency not allowed
|
||||
@ -1110,12 +1110,16 @@ void RADIO_PrepareTX(void)
|
||||
// ******************************
|
||||
// TX is allowed
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
UART_printf("radio prepare tx %u %s\r\n", g_dtmf_reply_state, g_dtmf_string);
|
||||
#endif
|
||||
|
||||
if (g_dtmf_reply_state == DTMF_REPLY_ANI)
|
||||
{
|
||||
if (g_dtmf_call_mode == DTMF_CALL_MODE_DTMF)
|
||||
{
|
||||
g_dtmf_is_tx = true;
|
||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||
g_dtmf_is_tx = true;
|
||||
g_dtmf_call_state = DTMF_CALL_STATE_NONE;
|
||||
g_dtmf_tx_stop_tick_500ms = dtmf_txstop_500ms;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user