Modified radio drivers so that bandwidth parameter in radio configuration is ignored for operating modes different from analog FM. Fixes #100

pull/102/head
Silvano Seva 2022-08-01 18:29:20 +02:00
rodzic 9a00b4e837
commit 1fa13d63d8
3 zmienionych plików z 46 dodań i 20 usunięć

Wyświetl plik

@ -118,6 +118,8 @@ void radio_setOpmode(const enum opmode mode)
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);
at1846s.setBandwidth(AT1846S_BW::_12P5);
at1846s.setTxDeviation(calData->data[currTxBand].mixGainNarrowband);
break;
default:
@ -316,16 +318,25 @@ void radio_updateConfiguration()
float apc = pwrLo + (pwrHi - pwrLo)/4.0f*(power - 1.0f);
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 == OPMODE_DMR))
// Set bandwidth, only for analog FM mode
if(config->opMode == OPMODE_FM)
{
at1846s.setBandwidth(AT1846S_BW::_12P5);
at1846s.setTxDeviation(calData->data[currTxBand].mixGainNarrowband);
}
else
{
at1846s.setBandwidth(AT1846S_BW::_25);
at1846s.setTxDeviation(calData->data[currTxBand].mixGainWideband);
switch(config->bandwidth)
{
case BW_12_5:
at1846s.setBandwidth(AT1846S_BW::_12P5);
at1846s.setTxDeviation(calData->data[currTxBand].mixGainNarrowband);
break;
case BW_20:
case BW_25:
at1846s.setBandwidth(AT1846S_BW::_25);
at1846s.setTxDeviation(calData->data[currTxBand].mixGainWideband);
break;
default:
break;
}
}
/*

Wyświetl plik

@ -207,12 +207,14 @@ void radio_setOpmode(const enum opmode mode)
case OPMODE_DMR:
gpio_clearPin(FM_SW); // Disable analog RX stage after superhet
gpio_setPin(DMR_SW); // Enable analog paths for DMR
_setBandwidth(BW_12_5); // Set bandwidth to 12.5kHz
//C5000_dmrMode();
break;
case OPMODE_M17:
gpio_clearPin(DMR_SW); // Disconnect analog paths for DMR
gpio_setPin(FM_SW); // Enable analog RX stage after superhet
_setBandwidth(BW_25); // Set bandwidth to 25kHz for proper deviation
C5000.fmMode(); // HR_C5000 in FM mode
C5000.setInputGain(-3); // Input gain in dB, found experimentally
break;
@ -352,10 +354,12 @@ void radio_updateConfiguration()
C5000.setModAmplitude(I, Q);
// Set bandwidth, force 12.5kHz for DMR mode
enum bandwidth bandwidth = static_cast< enum bandwidth >(config->bandwidth);
if(config->opMode == OPMODE_DMR) bandwidth = BW_12_5;
_setBandwidth(bandwidth);
// Set bandwidth, only for analog FM mode
if(config->opMode == OPMODE_FM)
{
enum bandwidth bw = static_cast< enum bandwidth >(config->bandwidth);
_setBandwidth(bw);
}
// Set CTCSS tone
float tone = static_cast< float >(config->txTone) / 10.0f;

Wyświetl plik

@ -120,11 +120,13 @@ void radio_setOpmode(const enum opmode mode)
case OPMODE_DMR:
at1846s.setOpMode(AT1846S_OpMode::DMR);
at1846s.setBandwidth(AT1846S_BW::_12P5);
// C6000.dmrMode();
break;
case OPMODE_M17:
at1846s.setOpMode(AT1846S_OpMode::DMR); // AT1846S in DMR mode, disables RX filter
at1846s.setBandwidth(AT1846S_BW::_25); // Set bandwidth to 25kHz for proper deviation
C6000.fmMode(); // HR_C6000 in FM mode
C6000.setInputGain(+6); // Input gain in dB, found experimentally
break;
@ -312,14 +314,23 @@ void radio_updateConfiguration()
calPoints);
C6000.setModAmplitude(0, Q);
// Set bandwidth, force 12.5kHz for DMR mode
if((config->bandwidth == BW_12_5) || (config->opMode == OPMODE_DMR))
// Set bandwidth, only for analog FM mode
if(config->opMode == OPMODE_FM)
{
at1846s.setBandwidth(AT1846S_BW::_12P5);
}
else
{
at1846s.setBandwidth(AT1846S_BW::_25);
switch(config->bandwidth)
{
case BW_12_5:
at1846s.setBandwidth(AT1846S_BW::_12P5);
break;
case BW_20:
case BW_25:
at1846s.setBandwidth(AT1846S_BW::_25);
break;
default:
break;
}
}
/*