Skip to content

Commit

Permalink
Merge pull request #1809 from db4ple/patch-6
Browse files Browse the repository at this point in the history
Fix TX PA range not obeyed
  • Loading branch information
df8oe authored Oct 25, 2019
2 parents c32698a + 15f718d commit a932dc7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mchf-eclipse/drivers/ui/radio_management.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,13 @@ void RadioManagement_MuteTemporarilyRxAudio()
Oscillator_ResultCodes_t RadioManagement_ValidateFrequencyForTX(uint32_t dial_freq)
{
// we check with the si570 code if the frequency is tunable, we do not tune to it.
bool osc_ok = osc->prepareNextFrequency(RadioManagement_Dial2TuneFrequency(dial_freq, TRX_MODE_TX), df.temp_factor);
// we also check if our PA is able to support this frequency
Oscillator_ResultCodes_t osc_res = osc->prepareNextFrequency(RadioManagement_Dial2TuneFrequency(dial_freq, TRX_MODE_TX), df.temp_factor);
bool osc_ok = osc_res == OSC_OK || osc_res == OSC_TUNE_LIMITED;

// we also check if our PA is able to support this frequency
bool pa_ok = dial_freq >= mchf_pa.min_freq && dial_freq <= mchf_pa.max_freq;

return pa_ok && osc_ok;
return pa_ok && osc_ok ? osc_res: OSC_TUNE_IMPOSSIBLE;
}

/**
Expand Down

0 comments on commit a932dc7

Please sign in to comment.