kopia lustrzana https://github.com/OpenRTX/OpenRTX
rodzic
5bf4df75ba
commit
d22948a096
|
@ -5,7 +5,7 @@
|
|||
channel_t get_default_channel()
|
||||
{
|
||||
channel_t channel;
|
||||
channel.mode = FM;
|
||||
channel.mode = OPMODE_FM;
|
||||
channel.bandwidth = BW_25;
|
||||
channel.power = 1.0;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ int nvm_readVFOChannelData(channel_t *channel)
|
|||
_addStringTerminator(channel->name, sizeof(chData.name));
|
||||
|
||||
/* Load mode-specific parameters */
|
||||
if(channel->mode == FM)
|
||||
if(channel->mode == OPMODE_FM)
|
||||
{
|
||||
channel->fm.txToneEn = 0;
|
||||
channel->fm.rxToneEn = 0;
|
||||
|
@ -242,7 +242,7 @@ int nvm_readVFOChannelData(channel_t *channel)
|
|||
|
||||
// TODO: Implement warning screen if tone was not found
|
||||
}
|
||||
else if(channel->mode == DMR)
|
||||
else if(channel->mode == OPMODE_DMR)
|
||||
{
|
||||
channel->dmr.contactName_index = chData.contact_name_index;
|
||||
channel->dmr.dmr_timeslot = chData.repeater_slot;
|
||||
|
@ -326,7 +326,7 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
|||
_addStringTerminator(channel->name, sizeof(chData.name));
|
||||
|
||||
/* Load mode-specific parameters */
|
||||
if(channel->mode == FM)
|
||||
if(channel->mode == OPMODE_FM)
|
||||
{
|
||||
channel->fm.txToneEn = 0;
|
||||
channel->fm.rxToneEn = 0;
|
||||
|
@ -362,7 +362,7 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
|||
|
||||
// TODO: Implement warning screen if tone was not found
|
||||
}
|
||||
else if(channel->mode == DMR)
|
||||
else if(channel->mode == OPMODE_DMR)
|
||||
{
|
||||
channel->dmr.contactName_index = chData.contact_name_index;
|
||||
channel->dmr.dmr_timeslot = chData.repeater_slot;
|
||||
|
|
|
@ -205,7 +205,7 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
|||
}
|
||||
|
||||
/* Load mode-specific parameters */
|
||||
if(channel->mode == FM)
|
||||
if(channel->mode == OPMODE_FM)
|
||||
{
|
||||
channel->fm.txToneEn = 0;
|
||||
channel->fm.rxToneEn = 0;
|
||||
|
@ -241,7 +241,7 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
|
|||
|
||||
// TODO: Implement warning screen if tone was not found
|
||||
}
|
||||
else if(channel->mode == DMR)
|
||||
else if(channel->mode == OPMODE_DMR)
|
||||
{
|
||||
channel->dmr.contactName_index = chData.contact_name_index;
|
||||
channel->dmr.dmr_timeslot = chData.repeater_slot;
|
||||
|
|
|
@ -106,7 +106,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
|
|||
}
|
||||
|
||||
/* Load mode-specific parameters */
|
||||
if(channel->mode == FM)
|
||||
if(channel->mode == OPMODE_FM)
|
||||
{
|
||||
channel->fm.txToneEn = 0;
|
||||
channel->fm.rxToneEn = 0;
|
||||
|
@ -142,7 +142,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
|
|||
|
||||
// TODO: Implement warning screen if tone was not found
|
||||
}
|
||||
else if(channel->mode == DMR)
|
||||
else if(channel->mode == OPMODE_DMR)
|
||||
{
|
||||
channel->dmr.contactName_index = chData.contact_name_index;
|
||||
channel->dmr.dmr_timeslot = chData.repeater_slot;
|
||||
|
|
|
@ -106,7 +106,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
|
|||
}
|
||||
|
||||
/* Load mode-specific parameters */
|
||||
if(channel->mode == FM)
|
||||
if(channel->mode == OPMODE_FM)
|
||||
{
|
||||
channel->fm.txToneEn = 0;
|
||||
channel->fm.rxToneEn = 0;
|
||||
|
@ -142,7 +142,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
|
|||
|
||||
// TODO: Implement warning screen if tone was not found
|
||||
}
|
||||
else if(channel->mode == DMR)
|
||||
else if(channel->mode == OPMODE_DMR)
|
||||
{
|
||||
channel->dmr.contactName_index = chData.contact_name_index;
|
||||
channel->dmr.dmr_timeslot = chData.repeater_slot;
|
||||
|
|
|
@ -108,13 +108,13 @@ void radio_setOpmode(const enum opmode mode)
|
|||
{
|
||||
switch(mode)
|
||||
{
|
||||
case FM:
|
||||
case OPMODE_FM:
|
||||
gpio_setPin(RX_AUDIO_MUX); // Audio out to amplifier
|
||||
gpio_clearPin(TX_AUDIO_MUX); // Audio in to microphone
|
||||
at1846s.setOpMode(AT1846S_OpMode::FM);
|
||||
break;
|
||||
|
||||
case DMR:
|
||||
case OPMODE_DMR:
|
||||
gpio_clearPin(RX_AUDIO_MUX); // Audio out to HR_C6000
|
||||
gpio_setPin(TX_AUDIO_MUX); // Audio in from HR_C6000
|
||||
at1846s.setOpMode(AT1846S_OpMode::DMR);
|
||||
|
@ -317,7 +317,7 @@ void radio_updateConfiguration()
|
|||
apcVoltage = static_cast< uint16_t >(apc) * 16;
|
||||
|
||||
// Set bandwidth and TX deviation, force 12.5kHz for DMR mode
|
||||
if((config->bandwidth == BW_12_5) || (config->opMode == DMR))
|
||||
if((config->bandwidth == BW_12_5) || (config->opMode == OPMODE_DMR))
|
||||
{
|
||||
at1846s.setBandwidth(AT1846S_BW::_12P5);
|
||||
at1846s.setTxDeviation(calData->data[currTxBand].mixGainNarrowband);
|
||||
|
|
|
@ -251,7 +251,7 @@ void radio_enableRx()
|
|||
|
||||
gpio_setPin(RX_STG_EN); // Enable RX LNA
|
||||
|
||||
if(config->opMode == FM)
|
||||
if(config->opMode == OPMODE_FM)
|
||||
{
|
||||
gpio_setPin(FM_MUTE); // In FM mode, unmute audio path towards speaker
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ void radio_updateConfiguration()
|
|||
const uint8_t *Ical = calData->sendIrange;
|
||||
const uint8_t *Qcal = calData->sendQrange;
|
||||
|
||||
if(config->opMode == FM)
|
||||
if(config->opMode == OPMODE_FM)
|
||||
{
|
||||
Ical = calData->analogSendIrange;
|
||||
Qcal = calData->analogSendQrange;
|
||||
|
@ -354,7 +354,7 @@ void radio_updateConfiguration()
|
|||
|
||||
// Set bandwidth, force 12.5kHz for DMR mode
|
||||
enum bandwidth bandwidth = static_cast< enum bandwidth >(config->bandwidth);
|
||||
if(config->opMode == DMR) bandwidth = BW_12_5;
|
||||
if(config->opMode == OPMODE_DMR) bandwidth = BW_12_5;
|
||||
_setBandwidth(bandwidth);
|
||||
|
||||
// Set CTCSS tone
|
||||
|
|
|
@ -274,15 +274,18 @@ void radio_updateConfiguration()
|
|||
freq_t *txCalPoints = cal->vhfCal.txFreq;
|
||||
uint8_t *loPwrCal = cal->vhfCal.txLowPower;
|
||||
uint8_t *hiPwrCal = cal->vhfCal.txHighPower;
|
||||
uint8_t *qRangeCal = (config->opMode == FM) ? cal->vhfCal.analogSendQrange
|
||||
uint8_t *qRangeCal = (config->opMode == OPMODE_FM)
|
||||
? cal->vhfCal.analogSendQrange
|
||||
: cal->vhfCal.sendQrange;
|
||||
|
||||
if(currTxBand == BND_UHF)
|
||||
{
|
||||
calPoints = 9;
|
||||
txCalPoints = cal->uhfCal.txFreq;
|
||||
loPwrCal = cal->uhfCal.txLowPower;
|
||||
hiPwrCal = cal->uhfCal.txHighPower;
|
||||
qRangeCal = (config->opMode == FM) ? cal->uhfCal.analogSendQrange
|
||||
qRangeCal = (config->opMode == OPMODE_FM)
|
||||
? cal->uhfCal.analogSendQrange
|
||||
: cal->uhfCal.sendQrange;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ int main(void)
|
|||
/* Take mutex and update the RTX configuration */
|
||||
OSMutexPend(&mutex, 0, OS_OPT_PEND_BLOCKING, NULL, &err);
|
||||
|
||||
cfg.opMode = FM;
|
||||
cfg.opMode = OPMODE_FM;
|
||||
cfg.bandwidth = BW_25;
|
||||
cfg.rxFrequency = rptFreq;
|
||||
cfg.txFrequency = rptFreq + rptShift;
|
||||
|
|
Ładowanie…
Reference in New Issue