From 1d8596e3c8190a0c4b0d8e346d38eb184873ab3d Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 1 Apr 2021 08:48:56 +0200 Subject: [PATCH] Renamed 'MD-UV380' folder and 'PLATFORM_MDUV380' define to, respectively, 'MD-UV3x0' and 'PLATFORM_MDUV3x0' to make them consistent with the meson build target --- meson.build | 6 +++--- openrtx/src/rtx.c | 16 ++++++++-------- .../targets/{MD-UV380 => MD-UV3x0}/hwconfig.h | 1 + .../targets/{MD-UV380 => MD-UV3x0}/platform.c | 0 4 files changed, 12 insertions(+), 11 deletions(-) rename platform/targets/{MD-UV380 => MD-UV3x0}/hwconfig.h (99%) rename platform/targets/{MD-UV380 => MD-UV3x0}/platform.c (100%) diff --git a/meson.build b/meson.build index ec3e861b..b4819dfb 100644 --- a/meson.build +++ b/meson.build @@ -180,13 +180,13 @@ mduv3x0_src = src + stm32f405_src + ['platform/drivers/display/HX8353_MDx.cpp', 'platform/drivers/tones/toneGenerator_MDx.c', 'platform/drivers/baseband/radio_UV3x0.c', 'platform/drivers/GPS/GPS_MDx.cpp', - 'platform/targets/MD-UV380/platform.c', + 'platform/targets/MD-UV3x0/platform.c', 'platform/drivers/baseband/AT1846S_UV3x0.c', 'platform/drivers/baseband/HR_C6000_UV3x0.c', 'platform/drivers/baseband/interfaces_UV3x0.c'] -mduv3x0_inc = inc + stm32f405_inc + ['platform/targets/MD-UV380'] -mduv3x0_def = def + stm32f405_def + {'PLATFORM_MDUV380': ''} +mduv3x0_inc = inc + stm32f405_inc + ['platform/targets/MD-UV3x0'] +mduv3x0_def = def + stm32f405_def + {'PLATFORM_MDUV3x0': ''} ## TYT MD-9600 diff --git a/openrtx/src/rtx.c b/openrtx/src/rtx.c index 10bab912..2102309b 100644 --- a/openrtx/src/rtx.c +++ b/openrtx/src/rtx.c @@ -23,7 +23,7 @@ #include #include #include -#ifdef PLATFORM_MDUV380 +#ifdef PLATFORM_MDUV3x0 #include "../../platform/drivers/baseband/HR_C6000.h" #endif @@ -47,7 +47,7 @@ float rssi; /* Current RSSI in dBm */ void _afCtrlInit() { - #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV380) + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) gpio_setMode(SPK_MUTE, OUTPUT); gpio_setMode(AUDIO_AMP_EN, OUTPUT); gpio_setMode(MIC_PWR, OUTPUT); @@ -63,7 +63,7 @@ void _afCtrlSpeaker(bool enable) { if(enable) { - #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV380) + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) gpio_setPin(AUDIO_AMP_EN); delayMs(10); gpio_clearPin(SPK_MUTE); @@ -76,7 +76,7 @@ void _afCtrlSpeaker(bool enable) } else { - #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV380) + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) gpio_setPin(SPK_MUTE); gpio_clearPin(AUDIO_AMP_EN); #ifdef PLATFORM_MD3x0 @@ -92,13 +92,13 @@ void _afCtrlMic(bool enable) { if(enable) { - #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV380) + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) gpio_setPin(MIC_PWR); #endif } else { - #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV380) + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) gpio_clearPin(MIC_PWR); #endif } @@ -119,7 +119,7 @@ void _afCtrlTerminate() * Knob position is given by an analog signal in the range 0 - 1500mV, * which has to be mapped in a range between 1 and 31. */ -#ifdef PLATFORM_MDUV380 +#ifdef PLATFORM_MDUV3x0 void _afSetVolume() { float level = (platform_getVolumeLevel() / 1560.0f) * 30.0f; @@ -289,7 +289,7 @@ void rtx_taskFunc() _afCtrlSpeaker(false); sqlOpen = false; } - #ifdef PLATFORM_MDUV380 + #ifdef PLATFORM_MDUV3x0 if(sqlOpen == true) { // Set output volume by changing the HR_C6000 DAC gain diff --git a/platform/targets/MD-UV380/hwconfig.h b/platform/targets/MD-UV3x0/hwconfig.h similarity index 99% rename from platform/targets/MD-UV380/hwconfig.h rename to platform/targets/MD-UV3x0/hwconfig.h index fb1eef18..542e3c8b 100644 --- a/platform/targets/MD-UV380/hwconfig.h +++ b/platform/targets/MD-UV3x0/hwconfig.h @@ -74,6 +74,7 @@ /* Analog inputs */ #define AIN_VOLUME GPIOA,0 #define AIN_VBAT GPIOA,1 +#define AIN_MIC GPIOA,3 /* Channel selection rotary encoder */ #define CH_SELECTOR_0 GPIOE,14 diff --git a/platform/targets/MD-UV380/platform.c b/platform/targets/MD-UV3x0/platform.c similarity index 100% rename from platform/targets/MD-UV380/platform.c rename to platform/targets/MD-UV3x0/platform.c