0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +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: