0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 06:11:24 +03:00

Fix missing TX audio when apollo quindar PTT ID tones are enabled.

This commit is contained in:
OneOfEleven 2023-10-09 11:00:57 +01:00
parent 16d51300d9
commit aae43131d9
8 changed files with 48 additions and 20 deletions

View File

@ -14,8 +14,6 @@
* limitations under the License.
*/
#ifdef ENABLE_AIRCOPY
#include "app/aircopy.h"
#include "audio.h"
#include "driver/bk4819.h"
@ -71,7 +69,9 @@ void AIRCOPY_StorePacket(void)
g_fsk_wite_index = 0;
g_update_display = true;
Status = BK4819_ReadRegister(BK4819_REG_0B);
Status = BK4819_ReadRegister(BK4819_REG_0B);
BK4819_PrepareFSKReceive();
// Doc says bit 4 should be 1 = CRC OK, 0 = CRC FAIL, but original firmware checks for FAIL.
@ -85,12 +85,11 @@ void AIRCOPY_StorePacket(void)
g_fsk_buffer[i + 1] ^= Obfuscation[i % 8];
CRC = CRC_Calculate(&g_fsk_buffer[1], 2 + 64);
if (g_fsk_buffer[34] == CRC)
{
const uint16_t *pData;
uint16_t Offset;
Offset = g_fsk_buffer[1];
uint16_t Offset = g_fsk_buffer[1];
if (Offset < 0x1E00)
{
pData = &g_fsk_buffer[2];
@ -110,6 +109,7 @@ void AIRCOPY_StorePacket(void)
}
}
}
g_errors_during_air_copyy++;
}
@ -121,7 +121,9 @@ static void AIRCOPY_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
unsigned int i;
INPUTBOX_Append(Key);
g_request_display_screen = DISPLAY_AIRCOPY;
if (g_input_box_index < 6)
{
#ifdef ENABLE_VOICE
@ -228,5 +230,3 @@ void AIRCOPY_ProcessKeys(key_code_t Key, bool key_pressed, bool key_held)
break;
}
}
#endif

View File

@ -237,6 +237,10 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_D_DCD:
case MENU_D_LIVE_DEC:
case MENU_AM:
*pMin = 0;
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
break;
#ifdef ENABLE_NOAA
case MENU_NOAA_S:
#endif
@ -247,7 +251,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_SCREN:
case MENU_TX_EN:
*pMin = 0;
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
*pMax = ARRAY_SIZE(g_sub_menu_DIS_EN) - 1;
break;
case MENU_SCR:
@ -656,7 +660,14 @@ void MENU_AcceptSetting(void)
case MENU_PTT_ID:
g_tx_vfo->dtmf_ptt_id_tx_mode = g_sub_menu_selection;
g_request_save_channel = 1;
g_request_save_channel = 1;
if (g_sub_menu_selection == PTT_ID_TX_DOWN ||
g_sub_menu_selection == PTT_ID_BOTH ||
g_sub_menu_selection == PTT_ID_APOLLO)
{
g_eeprom.roger_mode = ROGER_MODE_OFF;
break;
}
return;
case MENU_BAT_TXT:

View File

@ -1038,6 +1038,7 @@ void BK4819_PlaySingleTone(const unsigned int tone_Hz, const unsigned int delay,
BK4819_WriteRegister(BK4819_REG_70, 0x0000);
BK4819_WriteRegister(BK4819_REG_30, 0xC1FE);
BK4819_ExitTxMute();
}
void BK4819_EnterTxMute(void)

Binary file not shown.

Binary file not shown.

View File

@ -14,8 +14,6 @@
* limitations under the License.
*/
#ifdef ENABLE_AIRCOPY
#include <string.h>
#include "app/aircopy.h"
@ -61,5 +59,3 @@ void UI_DisplayAircopy(void)
ST7565_BlitFullScreen();
}
#endif

View File

@ -126,7 +126,7 @@ const t_menu_item g_menu_list[] =
// hidden menu items from here on
// enabled by pressing both the PTT and upper side button at power-on
{"F LOCK", VOICE_ID_INVALID, MENU_F_LOCK },
{"F LOCK", VOICE_ID_INVALID, MENU_F_LOCK }, // country/area specific
{"Tx 200", VOICE_ID_INVALID, MENU_200TX }, // was "200TX"
{"Tx 350", VOICE_ID_INVALID, MENU_350TX }, // was "350TX"
{"Tx 500", VOICE_ID_INVALID, MENU_500TX }, // was "500TX"
@ -325,6 +325,12 @@ const char g_sub_menu_BAT_TXT[3][8] =
"PERCENT"
};
const char g_sub_menu_DIS_EN[2][9] =
{
"DISABLED",
"ENABLED"
};
const char g_sub_menu_SCRAMBLER[11][7] =
{
"OFF",
@ -677,18 +683,33 @@ void UI_DisplayMenu(void)
case MENU_D_ST:
case MENU_D_DCD:
case MENU_D_LIVE_DEC:
strcpy(String, g_sub_menu_off_on[g_sub_menu_selection]);
break;
#ifdef ENABLE_NOAA
case MENU_NOAA_S:
strcpy(String, "SCAN\n");
strcat(String, g_sub_menu_DIS_EN[g_sub_menu_selection]);
break;
#endif
case MENU_350TX:
case MENU_200TX:
case MENU_500TX:
case MENU_350EN:
case MENU_SCREN:
case MENU_TX_EN:
strcpy(String, g_sub_menu_off_on[g_sub_menu_selection]);
strcpy(String, g_sub_menu_DIS_EN[g_sub_menu_selection]);
break;
case MENU_SCREN:
strcpy(String, "SCRAMBLER\n");
strcat(String, g_sub_menu_DIS_EN[g_sub_menu_selection]);
break;
case MENU_TX_EN:
strcpy(String, "TX\n");
strcat(String, g_sub_menu_DIS_EN[g_sub_menu_selection]);
break;
case MENU_MEM_CH:
case MENU_1_CALL:
case MENU_DEL_CH:

View File

@ -170,9 +170,8 @@ extern const char g_sub_menu_rx_tx[4][6];
extern const char g_sub_menu_AM_fix_test1[4][8];
#endif
extern const char g_sub_menu_BAT_TXT[3][8];
extern const char g_sub_menu_DIS_EN[2][9];
extern const char g_sub_menu_SCRAMBLER[11][7];
extern const char g_sub_menu_SIDE_BUTT[9][16];
extern bool g_is_in_sub_menu;