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 #LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-gc-sections,-T,firmware.ld
# compilation options # compilation options
#CFLAGS += -DBIG_FREQ_FONT CFLAGS += -DDISABLE_BIG_FREQ
CFLAGS += -DDISABLE_NOAA CFLAGS += -DDISABLE_NOAA
CFLAGS += -DDISABLE_VOICE CFLAGS += -DDISABLE_VOICE
CFLAGS += -DDISABLE_AIRCOPY CFLAGS += -DDISABLE_AIRCOPY
CFLAGS += -DKEEP_MEM_NAME
CFLAGS += -DDISABLE_ALARM CFLAGS += -DDISABLE_ALARM
CFLAGS += -DKEEP_MEM_NAME
CFLAGS += -DCHAN_NAME_FREQ CFLAGS += -DCHAN_NAME_FREQ
CFLAGS += -DSINGLE_VFO_CHAN #CFLAGS += -DENABLE_TX_WHEN_AM
#CFLAGS += -DSINGLE_VFO_CHAN
#CFLAGS += -DBAND_SCOPE #CFLAGS += -DBAND_SCOPE
ifeq ($(DEBUG),1) 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. 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 .. 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_NOAA .. remove NOAA channels option from the firmware
* CFLAGS += -DDISABLE_VOICE .. remove spoken VOICES option from the firmware * CFLAGS += -DDISABLE_VOICE .. remove spoken VOICES option from the firmware
* CFLAGS += -DDISABLE_AIRCOPY .. remove AIRCOPY option * 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 += -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 += -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 += -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) * #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" * "TXP" menu, renamed to "TX-PWR"
* "SAVE" menu, renamed to "B-SAVE" * "SAVE" menu, renamed to "B-SAVE"
* "WX" menu, renamed to "CROS-B" - 'WX' normally means weather here in the UK * "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" * "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 * "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 ?' 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, 17400000,
35000000, 35000000,
40000000, 40000000,
47000000, 47000000
}; };
const uint32_t MiddleFrequencyBandTable[7] = const uint32_t MiddleFrequencyBandTable[7] =
@ -37,7 +37,7 @@ const uint32_t MiddleFrequencyBandTable[7] =
26000000, 26000000,
37000000, 37000000,
43500000, 43500000,
55000000, 55000000
}; };
const uint32_t UpperLimitFrequencyBandTable[7] = const uint32_t UpperLimitFrequencyBandTable[7] =
@ -48,7 +48,7 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
34999990, 34999990,
39999990, 39999990,
46999990, 46999990,
60000000, 60000000
}; };
#ifndef DISABLE_NOAA #ifndef DISABLE_NOAA
@ -63,19 +63,31 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
16252500, 16252500,
16152500, 16152500,
16177500, 16177500,
16327500, 16327500
}; };
#endif #endif
const uint16_t StepFrequencyTable[6] = #if 0
{ const uint16_t StepFrequencyTable[6] =
250, {
500, 250,
625, 500,
1000, 625,
1250, 1000,
2500 1250,
}; 2500
};
#else
const uint16_t StepFrequencyTable[6] =
{
125,
250,
625,
1000,
1250,
2500
};
#endif
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency) FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
{ {
@ -135,47 +147,47 @@ int FREQUENCY_Check(VFO_Info_t *pInfo)
switch (gSetting_F_LOCK) switch (gSetting_F_LOCK)
{ {
case F_LOCK_FCC: case F_LOCK_FCC:
if (Frequency >= 14400000 && Frequency <= 14799990) if (Frequency >= 14400000 && Frequency < 14800000)
return 0; return 0;
if (Frequency >= 42000000 && Frequency <= 44999990) if (Frequency >= 42000000 && Frequency < 45000000)
return 0; return 0;
break; break;
case F_LOCK_CE: case F_LOCK_CE:
if (Frequency >= 14400000 && Frequency <= 14599990) if (Frequency >= 14400000 && Frequency < 14600000)
return 0; return 0;
break; break;
case F_LOCK_GB: case F_LOCK_GB:
if (Frequency >= 14400000 && Frequency <= 14799990) if (Frequency >= 14400000 && Frequency < 14800000)
return 0; return 0;
if (Frequency >= 43000000 && Frequency <= 43999990) if (Frequency >= 43000000 && Frequency < 44000000)
return 0; return 0;
break; break;
case F_LOCK_430: case F_LOCK_430:
if (Frequency >= 13600000 && Frequency <= 17399990) if (Frequency >= 13600000 && Frequency < 17400000)
return 0; return 0;
if (Frequency >= 40000000 && Frequency <= 42999990) if (Frequency >= 40000000 && Frequency < 43000000)
return 0; return 0;
break; break;
case F_LOCK_438: case F_LOCK_438:
if (Frequency >= 13600000 && Frequency <= 17399990) if (Frequency >= 13600000 && Frequency < 17400000)
return 0; return 0;
if (Frequency >= 40000000 && Frequency <= 43799990) if (Frequency >= 40000000 && Frequency < 43800000)
return 0; return 0;
break; break;
default: default:
if (Frequency >= 13600000 && Frequency <= 17399990) if (Frequency >= 13600000 && Frequency < 17400000)
return 0; return 0;
if (Frequency >= 35000000 && Frequency <= 39999990) if (Frequency >= 35000000 && Frequency < 40000000)
if (gSetting_350TX && gSetting_350EN) if (gSetting_350TX && gSetting_350EN)
return 0; return 0;
if (Frequency >= 40000000 && Frequency <= 46999990) if (Frequency >= 40000000 && Frequency < 47000000)
return 0; return 0;
if (Frequency >= 17400000 && Frequency <= 34999990) if (Frequency >= 17400000 && Frequency < 35000000)
if (gSetting_200TX) if (gSetting_200TX)
return 0; return 0;
if (Frequency >= 47000000 && Frequency <= 60000000) if (Frequency >= 47000000 && Frequency <= 60000000)

View File

@ -812,6 +812,13 @@ void RADIO_PrepareTX(void)
{ {
VfoState_t State; 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 (!FREQUENCY_Check(gCurrentVfo))
{ {
if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE) if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE)
@ -827,7 +834,7 @@ void RADIO_PrepareTX(void)
} }
else else
State = VFO_STATE_TX_DISABLE; State = VFO_STATE_TX_DISABLE;
RADIO_SetVfoState(State); RADIO_SetVfoState(State);
#ifndef DISABLE_ALARM #ifndef DISABLE_ALARM

View File

@ -98,22 +98,4 @@ void SystickHandler(void)
if (gVoxStopCountdown) if (gVoxStopCountdown)
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) switch (gEeprom.CHANNEL_DISPLAY_MODE)
{ {
case MDF_FREQUENCY: // show the channel frequency case MDF_FREQUENCY: // show the channel frequency
#ifdef BIG_FREQ_FONT #ifndef DISABLE_BIG_FREQ
NUMBER_ToDigits(frequency_Hz, String); NUMBER_ToDigits(frequency_Hz, String);
// show the main large frequency digits // show the main large frequency digits
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false); 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; frequency_Hz = gEeprom.VfoInfo[vfo_num].pTX->Frequency;
} }
#ifdef BIG_FREQ_FONT #ifndef DISABLE_BIG_FREQ
NUMBER_ToDigits(frequency_Hz, String); // 8 digits NUMBER_ToDigits(frequency_Hz, String); // 8 digits
// show the main large frequency digits // show the main large frequency digits
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false); UI_DisplayFrequency(String, 31, vfo_num * 4, false, false);