diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 69967706..7316672f 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -436,14 +436,21 @@ void _ui_timedate_add_digit(curTime_t *timedate, uint8_t pos, uint8_t number) bool _ui_freq_check_limits(freq_t freq) { bool valid = false; -#ifdef BAND_VHF - if(freq >= FREQ_LIMIT_VHF_LO && freq <= FREQ_LIMIT_VHF_HI) - valid = true; -#endif -#ifdef BAND_UHF - if(freq >= FREQ_LIMIT_UHF_LO && freq <= FREQ_LIMIT_UHF_HI) - valid = true; -#endif + const hwInfo_t* hwinfo = platform_getHwInfo(); + if(hwinfo->vhf_band) + { + // hwInfo_t frequencies are in MHz + if(freq >= (hwinfo->vhf_minFreq * 1000000) && + freq <= (hwinfo->vhf_maxFreq * 1000000)) + valid = true; + } + if(hwinfo->uhf_band) + { + // hwInfo_t frequencies are in MHz + if(freq >= (hwinfo->uhf_minFreq * 1000000) && + freq <= (hwinfo->uhf_maxFreq * 1000000)) + valid = true; + } return valid; } diff --git a/platform/targets/linux/platform.c b/platform/targets/linux/platform.c index 64800c29..353d2997 100644 --- a/platform/targets/linux/platform.c +++ b/platform/targets/linux/platform.c @@ -26,9 +26,15 @@ void platform_init() { //printf("Platform init\n"); // Fill hwinfo struct + memset(&hwInfo, 0x00, sizeof(hwInfo)); snprintf(hwInfo.name, 10, "Linux"); - hwInfo.vhf_band = 1; - hwInfo.uhf_band = 1; + // Frequencies are in MHz + hwInfo.vhf_maxFreq = 174; + hwInfo.vhf_minFreq = 136; + hwInfo.vhf_band = 1; + hwInfo.uhf_maxFreq = 480; + hwInfo.uhf_minFreq = 400; + hwInfo.uhf_band = 1; emulator_start(); }