diff --git a/platform/targets/MD-UV380/hwconfig.h b/platform/targets/MD-UV380/hwconfig.h index ce977d39..17fa7878 100644 --- a/platform/targets/MD-UV380/hwconfig.h +++ b/platform/targets/MD-UV380/hwconfig.h @@ -47,16 +47,11 @@ #define RED_LED GPIOE,1 /* Analog inputs */ -#define AIN_VOLUME GPIOA,0 #define AIN_VBAT GPIOA,1 -#define AIN_MIC GPIOA,3 -#define AIN_RSSI GPIOB,0 /* Channel selection rotary encoder */ #define CH_SELECTOR_0 GPIOE,14 -#define CH_SELECTOR_1 GPIOE,15 -#define CH_SELECTOR_2 GPIOB,10 -#define CH_SELECTOR_3 GPIOB,11 +#define CH_SELECTOR_1 GPIOB,11 /* Push-to-talk switch */ #define PTT_SW GPIOE,11 diff --git a/platform/targets/MD-UV380/platform.c b/platform/targets/MD-UV380/platform.c index bda70ec2..7591d3cc 100644 --- a/platform/targets/MD-UV380/platform.c +++ b/platform/targets/MD-UV380/platform.c @@ -55,8 +55,6 @@ void platform_init() gpio_setMode(CH_SELECTOR_0, INPUT); gpio_setMode(CH_SELECTOR_1, INPUT); - gpio_setMode(CH_SELECTOR_2, INPUT); - gpio_setMode(CH_SELECTOR_3, INPUT); gpio_setMode(PTT_SW, INPUT); @@ -108,12 +106,8 @@ void platform_terminate() gpio_clearPin(GREEN_LED); gpio_clearPin(RED_LED); - /* Shut down timer */ - RCC->APB2ENR &= ~RCC_APB2ENR_TIM8EN; - /* Shut down ADC */ adc1_terminate(); - } float platform_getVbat() @@ -128,22 +122,20 @@ float platform_getVbat() float platform_getMicLevel() { - return adc1_getMeasurement(2); + return 0.0f; } float platform_getVolumeLevel() { - return adc1_getMeasurement(3); + return 0.0f; } uint8_t platform_getChSelector() { - static const uint8_t rsPositions[] = { 11, 14, 10, 15, 6, 3, 7, 2, 12, 13, - 9, 16, 5, 4, 8, 1 }; + static const uint8_t rsPositions[] = { 1, 4, 2, 3}; int pos = gpio_readPin(CH_SELECTOR_0) | (gpio_readPin(CH_SELECTOR_1) << 1) - | (gpio_readPin(CH_SELECTOR_2) << 2) - | (gpio_readPin(CH_SELECTOR_3) << 3); + return rsPositions[pos]; }