diff --git a/openrtx/src/ui/module17/ui.c b/openrtx/src/ui/module17/ui.c index 13788ad1..b1c7928d 100644 --- a/openrtx/src/ui/module17/ui.c +++ b/openrtx/src/ui/module17/ui.c @@ -124,6 +124,7 @@ const char *info_items[] = "Used heap", "Hw Version", "HMI", + "BB Tuning Pot", }; const char *authors[] = diff --git a/openrtx/src/ui/module17/ui_menu.c b/openrtx/src/ui/module17/ui_menu.c index d7f8ecb3..f99d0f9a 100644 --- a/openrtx/src/ui/module17/ui_menu.c +++ b/openrtx/src/ui/module17/ui_menu.c @@ -60,6 +60,12 @@ const char *hmiVersions[] = "1.0" }; +const char *bbTuningPot[] = +{ + "Soft", + "Hard" +}; + void _ui_drawMenuList(uint8_t selected, int (*getCurrentEntry)(char *buf, uint8_t max_len, uint8_t index)) { point_t pos = layout.line1_pos; @@ -303,6 +309,16 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index) snprintf(buf, max_len, "%s", hmiVersions[0]); #endif break; + case 4: // Baseband tuning potentiometers + #ifdef PLATFORM_LINUX + snprintf(buf, max_len, "%s", "Linux"); + #else + if((hwinfo->flags & MOD17_FLAGS_SOFTPOT) != 0) + snprintf(buf, max_len, "%s", bbTuningPot[0]); + else + snprintf(buf, max_len, "%s", bbTuningPot[1]); + #endif + break; } return 0; } diff --git a/platform/targets/Module17/hwconfig.h b/platform/targets/Module17/hwconfig.h index 3bc02339..5010bd17 100644 --- a/platform/targets/Module17/hwconfig.h +++ b/platform/targets/Module17/hwconfig.h @@ -51,7 +51,8 @@ enum Mod17HmiVersion enum Mod17Flags { - MOD17_FLAGS_HMI_PRESENT = 1 + MOD17_FLAGS_HMI_PRESENT = 1, + MOD17_FLAGS_SOFTPOT = 2 }; #define MOD17_HWDET_THRESH 300000 /* Threshold for hardware detection, in uV */ diff --git a/platform/targets/Module17/platform.c b/platform/targets/Module17/platform.c index 1cb3a1fd..4956bacd 100644 --- a/platform/targets/Module17/platform.c +++ b/platform/targets/Module17/platform.c @@ -30,6 +30,7 @@ #include #include #include +#include ADC_STM32_DEVICE_DEFINE(adc1, ADC1, NULL, 3300000) @@ -105,8 +106,14 @@ void platform_init() nvm_init(); audio_init(); adcStm32_init(&adc1); - mcp4551_init(&i2c1, SOFTPOT_RX); - mcp4551_init(&i2c1, SOFTPOT_TX); + + /* Baseband tuning soft potentiometers */ + int ret = mcp4551_init(&i2c1, SOFTPOT_RX); + if(ret == 0) + { + hwInfo.flags |= MOD17_FLAGS_SOFTPOT; + mcp4551_init(&i2c1, SOFTPOT_TX); + } /* Set defaults for calibration */ mod17CalData.tx_wiper = 0x080;