TX disabled when radio set to 'AM' - compile option

This commit is contained in:
OneOfEleven 2023-09-11 08:45:29 +01:00
parent e5294129ae
commit 9ebe5b4e56
9 changed files with 58 additions and 55 deletions

View File

@ -93,14 +93,15 @@ LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
#LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-gc-sections,-T,firmware.ld
# compilation options
#CFLAGS += -DBIG_FREQ_FONT
CFLAGS += -DDISABLE_BIG_FREQ
CFLAGS += -DDISABLE_NOAA
CFLAGS += -DDISABLE_VOICE
CFLAGS += -DDISABLE_AIRCOPY
CFLAGS += -DKEEP_MEM_NAME
CFLAGS += -DDISABLE_ALARM
CFLAGS += -DKEEP_MEM_NAME
CFLAGS += -DCHAN_NAME_FREQ
CFLAGS += -DSINGLE_VFO_CHAN
#CFLAGS += -DENABLE_TX_WHEN_AM
#CFLAGS += -DSINGLE_VFO_CHAN
#CFLAGS += -DBAND_SCOPE
ifeq ($(DEBUG),1)

View File

@ -11,13 +11,14 @@ Am amazing achievement if you ask me !
This version you can customize at compile time by making various changes to the makefile.
You can edit those changes by (currently) editing the MakeFile, look for these lines ..
* CFLAGS += -DBIG_FREQ_FONT .. show frequency using big font
* CFLAGS += -DDISABLE_BIG_FREQ .. show frequencies using smaller font
* CFLAGS += -DDISABLE_NOAA .. remove NOAA channels option from the firmware
* CFLAGS += -DDISABLE_VOICE .. remove spoken VOICES option from the firmware
* CFLAGS += -DDISABLE_AIRCOPY .. remove AIRCOPY option
* CFLAGS += -DKEEP_MEM_NAME .. keep the memory channels name when re-saving a channel
* CFLAGS += -DDISABLE_ALARM .. remove the ALARM transmit option from the firmware
* CFLAGS += -DKEEP_MEM_NAME .. keep the memory channels name when re-saving a channel
* CFLAGS += -DCHAN_NAME_FREQ .. show the channel frequency (as well as channel number/name)
* #CFLAGS += -DENABLE_TX_WHEN_AM .. enable TX when radio set to AM (radio does NOT do AM, the adverts are false)
* #CFLAGS += -DSINGLE_VFO_CHAN .. (not yet implemented) show a single VFO/CHANNEL if dual-watch/cross-band are disabled
* #CFLAGS += -DBAND_SCOPE .. (not yet implemented) show a band scope (spectrum/panadapter)
@ -37,11 +38,11 @@ To enable the custom option just uncomment the line by removing the starting '#'
* "TXP" menu, renamed to "TX-PWR"
* "SAVE" menu, renamed to "B-SAVE"
* "WX" menu, renamed to "CROS-B" - 'WX' normally means weather here in the UK
* "ABR" menu, renamed to "BAK-LT", shows extended backlight times, now has always ON option
* "ABR" menu, renamed to "BAK-LT", shows extended backlight times, includes always ON option
* "SCR" menu, renamed to "SCRAM"
* "MIC" menu, shows mic gain in dB's, now includes the max mic gain possible (+15.5dB)
* "MIC" menu, shows mic gain in dB's, includes max mic gain possible (+15.5dB)
* "VOL" menu, renamed to "BATVOL", shows voltage and percentage
* "AM" menu, renamed to "MODE", shows modulation mode
* "AM" menu, renamed to "MODE", shows RX modulation mode
Menu renames are to try and reduce 'WTF does that do/mean ?'

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -26,7 +26,7 @@ const uint32_t LowerLimitFrequencyBandTable[7] =
17400000,
35000000,
40000000,
47000000,
47000000
};
const uint32_t MiddleFrequencyBandTable[7] =
@ -37,7 +37,7 @@ const uint32_t MiddleFrequencyBandTable[7] =
26000000,
37000000,
43500000,
55000000,
55000000
};
const uint32_t UpperLimitFrequencyBandTable[7] =
@ -48,7 +48,7 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
34999990,
39999990,
46999990,
60000000,
60000000
};
#ifndef DISABLE_NOAA
@ -63,19 +63,31 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
16252500,
16152500,
16177500,
16327500,
16327500
};
#endif
const uint16_t StepFrequencyTable[6] =
{
250,
500,
625,
1000,
1250,
2500
};
#if 0
const uint16_t StepFrequencyTable[6] =
{
250,
500,
625,
1000,
1250,
2500
};
#else
const uint16_t StepFrequencyTable[6] =
{
125,
250,
625,
1000,
1250,
2500
};
#endif
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
{
@ -135,47 +147,47 @@ int FREQUENCY_Check(VFO_Info_t *pInfo)
switch (gSetting_F_LOCK)
{
case F_LOCK_FCC:
if (Frequency >= 14400000 && Frequency <= 14799990)
if (Frequency >= 14400000 && Frequency < 14800000)
return 0;
if (Frequency >= 42000000 && Frequency <= 44999990)
if (Frequency >= 42000000 && Frequency < 45000000)
return 0;
break;
case F_LOCK_CE:
if (Frequency >= 14400000 && Frequency <= 14599990)
if (Frequency >= 14400000 && Frequency < 14600000)
return 0;
break;
case F_LOCK_GB:
if (Frequency >= 14400000 && Frequency <= 14799990)
if (Frequency >= 14400000 && Frequency < 14800000)
return 0;
if (Frequency >= 43000000 && Frequency <= 43999990)
if (Frequency >= 43000000 && Frequency < 44000000)
return 0;
break;
case F_LOCK_430:
if (Frequency >= 13600000 && Frequency <= 17399990)
if (Frequency >= 13600000 && Frequency < 17400000)
return 0;
if (Frequency >= 40000000 && Frequency <= 42999990)
if (Frequency >= 40000000 && Frequency < 43000000)
return 0;
break;
case F_LOCK_438:
if (Frequency >= 13600000 && Frequency <= 17399990)
if (Frequency >= 13600000 && Frequency < 17400000)
return 0;
if (Frequency >= 40000000 && Frequency <= 43799990)
if (Frequency >= 40000000 && Frequency < 43800000)
return 0;
break;
default:
if (Frequency >= 13600000 && Frequency <= 17399990)
if (Frequency >= 13600000 && Frequency < 17400000)
return 0;
if (Frequency >= 35000000 && Frequency <= 39999990)
if (Frequency >= 35000000 && Frequency < 40000000)
if (gSetting_350TX && gSetting_350EN)
return 0;
if (Frequency >= 40000000 && Frequency <= 46999990)
if (Frequency >= 40000000 && Frequency < 47000000)
return 0;
if (Frequency >= 17400000 && Frequency <= 34999990)
if (Frequency >= 17400000 && Frequency < 35000000)
if (gSetting_200TX)
return 0;
if (Frequency >= 47000000 && Frequency <= 60000000)

View File

@ -812,6 +812,13 @@ void RADIO_PrepareTX(void)
{
VfoState_t State;
#ifndef ENABLE_TX_WHEN_AM
// disable the TX when VFO/Channel is set to AM
// the radio does NOT do AM, the adverts are false
if (gCurrentVfo->IsAM)
State = VFO_STATE_TX_DISABLE;
else
#endif
if (!FREQUENCY_Check(gCurrentVfo))
{
if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE)
@ -827,7 +834,7 @@ void RADIO_PrepareTX(void)
}
else
State = VFO_STATE_TX_DISABLE;
RADIO_SetVfoState(State);
#ifndef DISABLE_ALARM

View File

@ -98,22 +98,4 @@ void SystickHandler(void)
if (gVoxStopCountdown)
gVoxStopCountdown--;
#if 0
if (gCurrentFunction == FUNCTION_TRANSMIT || gBacklightCountdown > 0)
{
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON
}
else
if (gEeprom.BACKLIGHT >= 5)
{ // backlight ON - half brightness
// was hoping to use this but don't like the odd flicker
if (gGlobalSysTickCounter & 1)
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON
else
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
}
else
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
#endif
}

View File

@ -267,7 +267,7 @@ void UI_DisplayMain(void)
switch (gEeprom.CHANNEL_DISPLAY_MODE)
{
case MDF_FREQUENCY: // show the channel frequency
#ifdef BIG_FREQ_FONT
#ifndef DISABLE_BIG_FREQ
NUMBER_ToDigits(frequency_Hz, String);
// show the main large frequency digits
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false);
@ -329,7 +329,7 @@ void UI_DisplayMain(void)
frequency_Hz = gEeprom.VfoInfo[vfo_num].pTX->Frequency;
}
#ifdef BIG_FREQ_FONT
#ifndef DISABLE_BIG_FREQ
NUMBER_ToDigits(frequency_Hz, String); // 8 digits
// show the main large frequency digits
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false);