From 01b4a98f858f6672ecb4bf97fb66baf6ee6cc160 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Sat, 5 Jun 2021 11:06:22 +0200 Subject: [PATCH] Set initial frequency based on supported bands (TG-239) --- openrtx/src/state.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openrtx/src/state.c b/openrtx/src/state.c index 83e44b81..d2e1d410 100644 --- a/openrtx/src/state.c +++ b/openrtx/src/state.c @@ -53,8 +53,18 @@ void state_init() state.channel.mode = FM; state.channel.bandwidth = BW_25; state.channel.power = 1.0; - state.channel.rx_frequency = 430000000; - state.channel.tx_frequency = 430000000; + const hwInfo_t* hwinfo = platform_getHwInfo(); + // Set initial frequency based on supported bands + if(hwinfo->uhf_band) + { + state.channel.rx_frequency = 430000000; + state.channel.tx_frequency = 430000000; + } + else if(hwinfo->vhf_band) + { + state.channel.rx_frequency = 144000000; + state.channel.tx_frequency = 144000000; + } state.channel.fm.rxToneEn = 0; state.channel.fm.rxTone = 2; // 71.9Hz state.channel.fm.txToneEn = 1;