This commit is contained in:
Nunu 2024-02-04 12:46:04 +01:00
parent b655393ff7
commit 5907126b14
3 changed files with 29 additions and 19 deletions

View File

@ -179,7 +179,14 @@ void MSG_SendPacket() {
if ( msgStatus != READY ) return;
if ( strlen((char *)dataPacket.data.payload) > 0 && (TX_freq_check(gCurrentVfo->pTX->Frequency) == 0) ) {
RADIO_PrepareTX();
if(RADIO_GetVfoState() != VFO_STATE_NORMAL){
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}
if ( strlen((char *)dataPacket.data.payload) > 0) {
msgStatus = SENDING;
@ -220,8 +227,6 @@ void MSG_SendPacket() {
// mute the mic during TX
gMuteMic = true;
FUNCTION_Select(FUNCTION_TRANSMIT);
SYSTEM_DelayMs(50);
MSG_FSKSendData();

View File

@ -914,6 +914,10 @@ void RADIO_SetVfoState(VfoState_t State)
gUpdateDisplay = true;
}
VfoState_t RADIO_GetVfoState() {
return VfoState[(gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO];
}
void RADIO_PrepareTX(void)
{
VfoState_t State = VFO_STATE_NORMAL; // default to OK to TX

33
radio.h
View File

@ -155,24 +155,25 @@ extern VfoState_t VfoState[2];
// determines whether mic should be muted during TX (i.e during FSK modem TX)
extern bool gMuteMic;
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
void RADIO_ApplyTxOffset(VFO_Info_t *pInfo);
void RADIO_SelectVfos(void);
void RADIO_SetupRegisters(bool bSwitchToFunction0);
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
void RADIO_ApplyTxOffset(VFO_Info_t *pInfo);
void RADIO_SelectVfos(void);
void RADIO_SetupRegisters(bool bSwitchToFunction0);
#ifdef ENABLE_NOAA
void RADIO_ConfigureNOAA(void);
void RADIO_ConfigureNOAA(void);
#endif
void RADIO_SetTxParameters(void);
void RADIO_SetModulation(ModulationMode_t modulation);
void RADIO_SetVfoState(VfoState_t State);
void RADIO_PrepareTX(void);
void RADIO_EnableCxCSS(void);
void RADIO_PrepareCssTX(void);
void RADIO_SendEndOfTransmission(bool playRoger);
void RADIO_SetTxParameters(void);
void RADIO_SetModulation(ModulationMode_t modulation);
void RADIO_SetVfoState(VfoState_t State);
VfoState_t RADIO_GetVfoState();
void RADIO_PrepareTX(void);
void RADIO_EnableCxCSS(void);
void RADIO_PrepareCssTX(void);
void RADIO_SendEndOfTransmission(bool playRoger);
#endif
#ifdef ENABLE_SPECTRUM_CHANNEL_SCAN