Display channel offset with TX and RX channel frequencies on startup

This commit is contained in:
Andreas Eversberg
2017-10-12 19:43:15 +02:00
parent e67c171035
commit f7a0e4622b
12 changed files with 32 additions and 9 deletions

View File

@@ -254,6 +254,8 @@ double nmt_channel2freq(int nmt_system, const char *short_name, int channel, int
for (j = 0; nmt_country[i].nmt_frequency[j].first_frequency; j++) {
if (channel >= nmt_country[i].nmt_frequency[j].first_channel
&& channel <= nmt_country[i].nmt_frequency[j].last_channel) {
if (uplink == 2)
return -nmt_country[i].nmt_frequency[j].duplex_spacing * 1e6;
/* add "channel offset" * "channel spacing" to "first frequency" */
freq = nmt_country[i].nmt_frequency[j].first_frequency;
freq += (double)(channel - nmt_country[i].nmt_frequency[j].first_channel) * nmt_country[i].nmt_frequency[j].channel_spacing;