Set initial frequency based on supported bands (TG-239)

replace/a52cca7d8ef066a7ed8f6048233b2b33621be131
Federico Amedeo Izzo 2021-06-05 11:06:22 +02:00
rodzic f5c9d97e49
commit 01b4a98f85
1 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -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;