Fix DTM TX-UP only

This commit is contained in:
OneOfEleven 2023-10-02 19:23:37 +01:00
parent 9ac3525683
commit c59e0ea06c
9 changed files with 52 additions and 53 deletions

View File

@ -22,7 +22,7 @@ ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
ENABLE_MAIN_KEY_HOLD := 1
ENABLE_BOOT_BEEPS := 0
ENABLE_COMPANDER := 1
ENABLE_SHOW_CHARGE_LEVEL := 1
ENABLE_SHOW_CHARGE_LEVEL := 0
ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_CODE_SCAN_TIMEOUT := 0
ENABLE_AM_FIX := 1

View File

@ -641,9 +641,11 @@ static void FREQ_NextChannel(void)
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
RADIO_SetupRegisters(true);
gUpdateDisplay = true;
ScanPauseDelayIn_10ms = scan_pause_delay_in_6_10ms;
bScanKeepFrequency = false;
// ScanPauseDelayIn_10ms = scan_pause_delay_in_6_10ms;
ScanPauseDelayIn_10ms = 10; // 100ms
bScanKeepFrequency = false;
gUpdateDisplay = true;
}
static void MR_NextChannel(void)
@ -723,7 +725,7 @@ static void MR_NextChannel(void)
}
// ScanPauseDelayIn_10ms = scan_pause_delay_in_3_10ms;
ScanPauseDelayIn_10ms = 8; // 100ms .. <= ~60ms it misses signals (squelch response and/or PLL lock time) ?
ScanPauseDelayIn_10ms = 8; // 80ms .. <= ~60ms it misses signals (squelch response and/or PLL lock time) ?
bScanKeepFrequency = false;
@ -1780,11 +1782,18 @@ void APP_TimeSlice500ms(void)
BATTERY_GetReadings(true);
}
// regular statusbar updates (once every 2 sec) if need be
// regular display updates (once every 2 sec) - if need be
if ((gBatteryCheckCounter & 3) == 0)
{
if (gChargingWithTypeC || gSetting_battery_text > 0)
gUpdateStatus = true;
#ifdef ENABLE_SHOW_CHARGE_LEVEL
if (gChargingWithTypeC)
gUpdateDisplay = true;
#endif
}
if (gCurrentFunction != FUNCTION_POWER_SAVE)
updateRSSI(gEeprom.RX_CHANNEL);

View File

@ -159,7 +159,7 @@ DTMF_CallMode_t DTMF_CheckGroupCall(const char *pMsg, const unsigned int size)
for (i = 0; i < size; i++)
if (pMsg[i] == gEeprom.DTMF_GROUP_CALL_CODE)
break;
return (i < size) ? DTMF_CALL_MODE_GROUP : DTMF_CALL_MODE_NOT_GROUP;
}
@ -189,7 +189,7 @@ void DTMF_HandleRequest(void)
DTMF_clear_RX();
return;
}
if (!gRxVfo->DTMF_DECODING_ENABLE && !gSetting_KILLED)
{ // D-DCD is disabled or we're alive
DTMF_clear_RX();
@ -207,7 +207,7 @@ void DTMF_HandleRequest(void)
if (DTMF_CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
{ // bugger
if (gEeprom.PERMIT_REMOTE_KILL)
{
gSetting_KILLED = true; // oooerr !
@ -238,17 +238,17 @@ void DTMF_HandleRequest(void)
return;
}
}
if (gDTMF_RX_index >= 9)
{ // look for the REVIVE code
sprintf(String, "%s%c%s", gEeprom.ANI_DTMF_ID, gEeprom.DTMF_SEPARATE_CODE, gEeprom.REVIVE_CODE);
Offset = gDTMF_RX_index - strlen(String);
if (DTMF_CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
{ // shit, we're back !
gSetting_KILLED = false;
DTMF_clear_RX();
@ -268,7 +268,7 @@ void DTMF_HandleRequest(void)
{ // look for ACK reply
strcpy(String, "AB");
Offset = gDTMF_RX_index - strlen(String);
if (DTMF_CompareMessage(gDTMF_RX + Offset, String, strlen(String), true))
@ -290,7 +290,7 @@ void DTMF_HandleRequest(void)
gDTMF_CallMode == DTMF_CALL_MODE_NOT_GROUP &&
gDTMF_RX_index >= 9)
{ // waiting for a reply
sprintf(String, "%s%c%s", gDTMF_String, gEeprom.DTMF_SEPARATE_CODE, "AAAAA");
Offset = gDTMF_RX_index - strlen(String);
@ -373,25 +373,27 @@ void DTMF_Reply(void)
pString = String;
}
break;
case DTMF_REPLY_AB:
pString = "AB";
break;
case DTMF_REPLY_AAAAA:
sprintf(String, "%s%c%s", gEeprom.ANI_DTMF_ID, gEeprom.DTMF_SEPARATE_CODE, "AAAAA");
pString = String;
break;
default:
case DTMF_REPLY_NONE:
if (gDTMF_CallState != DTMF_CALL_STATE_NONE ||
gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_OFF ||
gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_BOT)
gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_EOT)
{
gDTMF_ReplyState = DTMF_REPLY_NONE;
return;
}
// send TX-UP DTMF
pString = gEeprom.DTMF_UP_CODE;
break;
}
@ -400,16 +402,16 @@ void DTMF_Reply(void)
if (pString == NULL)
return;
Delay = gEeprom.DTMF_PRELOAD_TIME;
if (gEeprom.DTMF_SIDE_TONE)
{ // the will also hear the transmitted tones
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
gEnableSpeaker = true;
Delay = (gEeprom.DTMF_PRELOAD_TIME < 60) ? 60 : gEeprom.DTMF_PRELOAD_TIME;
}
SYSTEM_DelayMs(Delay);
BK4819_EnterDTMF_TX(gEeprom.DTMF_SIDE_TONE);

Binary file not shown.

Binary file not shown.

View File

@ -25,6 +25,7 @@ const freq_band_table_t BX4819_band2 = {84000000, 130000000};
const freq_band_table_t frequencyBandTable[7] =
{
#ifndef ENABLE_WIDE_RX
// QS original
{ 5000000, 7600000},
{10800000, 13600000},
{13600000, 17400000},
@ -33,6 +34,7 @@ const freq_band_table_t frequencyBandTable[7] =
{40000000, 47000000},
{47000000, 60000000}
#else
// extended range
{ 1800000, 10800000},
{10800000, 13600000},
{13600000, 17400000},
@ -59,28 +61,12 @@ const freq_band_table_t frequencyBandTable[7] =
};
#endif
#if 0
const uint16_t StepFrequencyTable[7] =
{
250,
500,
625,
1000,
1250,
2500,
833
};
#ifndef ENABLE_12_5KHZ_STEP
// QS steps (*10 Hz)
const uint16_t StepFrequencyTable[7] = {250, 500, 625, 1000, 1250, 2500, 833};
#else
const uint16_t StepFrequencyTable[7] =
{
125,
250,
625,
1000,
1250,
2500,
833
};
// includes 1.25kHz step
const uint16_t StepFrequencyTable[7] = {125, 250, 625, 1000, 1250, 2500, 833};
#endif
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
@ -89,7 +75,8 @@ FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
for (band = ARRAY_SIZE(frequencyBandTable) - 1; band >= 0; band--)
if (Frequency >= frequencyBandTable[band].lower)
// if (Frequency < frequencyBandTable[band].upper)
return band;
return (FREQUENCY_Band_t)band;
return BAND1_50MHz;
// return BAND_NONE;
}

View File

@ -19,7 +19,7 @@
#include <stdint.h>
//#include "radio.h"
#define ENABLE_12_5KHZ_STEP
typedef struct {
const uint32_t lower;
@ -43,7 +43,8 @@ enum FREQUENCY_Band_t {
};
typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;
#if 0
#ifndef ENABLE_12_5KHZ_STEP
// QS steps
enum STEP_Setting_t {
STEP_2_5kHz = 0,
STEP_5_0kHz,
@ -54,6 +55,7 @@ typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;
STEP_8_33kHz
};
#else
// includes 1.25kHz step
enum STEP_Setting_t {
STEP_1_25kHz = 0,
STEP_2_5kHz,
@ -66,12 +68,12 @@ typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;
#endif
typedef enum STEP_Setting_t STEP_Setting_t;
extern const uint16_t StepFrequencyTable[7];
#ifdef ENABLE_NOAA
extern const uint32_t NoaaFrequencyTable[10];
#endif
extern const uint16_t StepFrequencyTable[7];
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency);
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency);
uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower);
@ -80,4 +82,3 @@ int TX_freq_check(const uint32_t Frequency);
int RX_freq_check(const uint32_t Frequency);
#endif

View File

@ -43,10 +43,10 @@ enum {
};
enum PTT_ID_t {
PTT_ID_OFF = 0,
PTT_ID_BOT,
PTT_ID_EOT,
PTT_ID_BOTH
PTT_ID_OFF = 0, // OFF
PTT_ID_BOT, // BEGIN OF TX
PTT_ID_EOT, // END OF TX
PTT_ID_BOTH // BOTH
};
typedef enum PTT_ID_t PTT_ID_t;

View File

@ -455,7 +455,7 @@ void UI_DisplayMenu(void)
#endif
case MENU_STEP:
sprintf(String, "%d.%02uKHz", StepFrequencyTable[gSubMenuSelection] / 100, abs(StepFrequencyTable[gSubMenuSelection]) % 100);
sprintf(String, "%d.%02ukHz", StepFrequencyTable[gSubMenuSelection] / 100, abs(StepFrequencyTable[gSubMenuSelection]) % 100);
break;
case MENU_TXP: