mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
fix dtmf tx
This commit is contained in:
parent
c68bff681e
commit
34c80a6805
23
app/dtmf.c
23
app/dtmf.c
@ -24,6 +24,9 @@
|
|||||||
#include "driver/eeprom.h"
|
#include "driver/eeprom.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/system.h"
|
#include "driver/system.h"
|
||||||
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
|
#include "driver/uart.h"
|
||||||
|
#endif
|
||||||
#include "dtmf.h"
|
#include "dtmf.h"
|
||||||
#include "external/printf/printf.h"
|
#include "external/printf/printf.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
@ -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 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;
|
const char *pString = NULL;
|
||||||
char String[23];
|
char str[23];
|
||||||
|
|
||||||
switch (g_dtmf_reply_state)
|
switch (g_dtmf_reply_state)
|
||||||
{
|
{
|
||||||
@ -401,9 +404,14 @@ bool DTMF_Reply(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // append our ID code onto the end of the DTMF code to send
|
{ // 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);
|
sprintf(str, "%s%c%s", g_dtmf_string, g_eeprom.config.setting.dtmf.separate_code, g_eeprom.config.setting.dtmf.ani_id);
|
||||||
pString = String;
|
pString = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
|
// UART_printf("dtmf tx reply ani %s\r\n", pString);
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DTMF_REPLY_AB:
|
case DTMF_REPLY_AB:
|
||||||
@ -411,12 +419,17 @@ bool DTMF_Reply(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DTMF_REPLY_AAAAA:
|
case DTMF_REPLY_AAAAA:
|
||||||
sprintf(String, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
sprintf(str, "%s%c%s", g_eeprom.config.setting.dtmf.ani_id, g_eeprom.config.setting.dtmf.separate_code, "AAAAA");
|
||||||
pString = String;
|
pString = str;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case DTMF_REPLY_NONE:
|
case DTMF_REPLY_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 ||
|
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_APOLLO ||
|
||||||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
|
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
|
||||||
|
@ -209,7 +209,7 @@ void GENERIC_Key_PTT(bool key_pressed)
|
|||||||
if (g_dtmf_input_box_index < sizeof(g_dtmf_input_box))
|
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
|
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 -
|
// append our DTMF ID to the inputted DTMF code -
|
||||||
// IF the user inputted code is exactly 3 digits long
|
// IF the user inputted code is exactly 3 digits long
|
||||||
if (g_dtmf_input_box_index == 3)
|
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_reply_state = DTMF_REPLY_ANI;
|
||||||
g_dtmf_state = DTMF_STATE_0;
|
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();
|
DTMF_clear_input_box();
|
||||||
|
@ -363,6 +363,7 @@ void processFKeyFunction(const key_code_t Key)
|
|||||||
#ifdef ENABLE_PANADAPTER
|
#ifdef ENABLE_PANADAPTER
|
||||||
if (g_fkey_pressed)
|
if (g_fkey_pressed)
|
||||||
{
|
{
|
||||||
|
g_fkey_pressed = false;
|
||||||
g_eeprom.config.setting.panadapter = (g_eeprom.config.setting.panadapter + 1) & 1u;
|
g_eeprom.config.setting.panadapter = (g_eeprom.config.setting.panadapter + 1) & 1u;
|
||||||
g_request_save_settings = true;
|
g_request_save_settings = true;
|
||||||
break;
|
break;
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -180,7 +180,6 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
g_flag_end_tx = false;
|
g_flag_end_tx = false;
|
||||||
|
|
||||||
g_rtte_count_down = 0;
|
g_rtte_count_down = 0;
|
||||||
g_dtmf_reply_state = DTMF_REPLY_NONE;
|
|
||||||
|
|
||||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||||
if (g_alarm_state == ALARM_STATE_OFF)
|
if (g_alarm_state == ALARM_STATE_OFF)
|
||||||
@ -234,6 +233,10 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
|
|
||||||
RADIO_enableTX(false);
|
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 defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||||
if (g_alarm_state != ALARM_STATE_OFF)
|
if (g_alarm_state != ALARM_STATE_OFF)
|
||||||
{
|
{
|
||||||
|
10
radio.c
10
radio.c
@ -1085,9 +1085,9 @@ void RADIO_PrepareTX(void)
|
|||||||
else
|
else
|
||||||
if (g_battery_display_level == 0)
|
if (g_battery_display_level == 0)
|
||||||
State = VFO_STATE_BAT_LOW; // charge your battery !
|
State = VFO_STATE_BAT_LOW; // charge your battery !
|
||||||
else
|
// else
|
||||||
if (g_battery_display_level >= 6)
|
// if (g_battery_display_level >= 6)
|
||||||
State = VFO_STATE_VOLTAGE_HIGH; // over voltage (no doubt to protect the PA) .. this is being a pain
|
// State = VFO_STATE_VOLTAGE_HIGH; // over voltage (no doubt to protect the PA) .. this is being a pain
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
State = VFO_STATE_TX_DISABLE; // TX frequency not allowed
|
State = VFO_STATE_TX_DISABLE; // TX frequency not allowed
|
||||||
@ -1110,6 +1110,10 @@ void RADIO_PrepareTX(void)
|
|||||||
// ******************************
|
// ******************************
|
||||||
// TX is allowed
|
// 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_reply_state == DTMF_REPLY_ANI)
|
||||||
{
|
{
|
||||||
if (g_dtmf_call_mode == DTMF_CALL_MODE_DTMF)
|
if (g_dtmf_call_mode == DTMF_CALL_MODE_DTMF)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user