From b5a20719b05584955ac70d54929cbac962416067 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Sat, 29 Mar 2025 18:56:43 +0100 Subject: [PATCH] DM-1701: audio driver --- platform/drivers/audio/audio_MDx.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/drivers/audio/audio_MDx.cpp b/platform/drivers/audio/audio_MDx.cpp index 3d8f043e..c4884533 100644 --- a/platform/drivers/audio/audio_MDx.cpp +++ b/platform/drivers/audio/audio_MDx.cpp @@ -30,7 +30,7 @@ #include "stm32_pwm.h" #include "stm32_adc.h" -#ifdef PLATFORM_MDUV3x0 +#if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701) #include #include "Cx000_dac.h" #endif @@ -73,7 +73,7 @@ static const struct PwmChannelCfg stm32pwm_cfg = stm32pwm_stopCbk }; -#ifdef PLATFORM_MDUV3x0 +#if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701) static void *audio_thread(void *arg) { (void) arg; @@ -109,7 +109,7 @@ static void *audio_thread(void *arg) const struct audioDevice outputDevices[] = { {NULL, NULL, 0, SINK_MCU}, - #ifdef PLATFORM_MDUV3x0 + #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701) {&Cx000_dac_audio_driver, NULL, 0, SINK_SPK}, #else {&stm32_pwm_audio_driver, &stm32pwm_cfg, 0, SINK_SPK}, @@ -149,7 +149,7 @@ void audio_init() stm32pwm_init(); stm32adc_init(STM32_ADC_ADC2); - #ifdef PLATFORM_MDUV3x0 + #if defined(PLATFORM_MDUV3x0) || defined (PLATFORM_DM1701) gpio_setMode(DMR_CLK, OUTPUT); gpio_setMode(DMR_MOSI, OUTPUT); gpio_setMode(DMR_MISO, INPUT); @@ -203,7 +203,7 @@ void audio_connect(const enum AudioSource source, const enum AudioSink sink) // MD-UV380 uses HR_C6000 for MCU->SPK audio output. Switching between // incoming FM audio and DAC output is done automatically inside the IC. - #ifndef PLATFORM_MDUV3x0 + #if !defined(PLATFORM_MDUV3x0) && !defined(PLATFORM_DM1701) case PATH(SOURCE_MCU, SINK_SPK): #endif case PATH(SOURCE_MCU, SINK_RTX): @@ -251,7 +251,7 @@ void audio_disconnect(const enum AudioSource source, const enum AudioSink sink) radio_disableAfOutput(); break; - #ifndef PLATFORM_MDUV3x0 + #if !defined(PLATFORM_MDUV3x0) && !defined(PLATFORM_DM1701) case PATH(SOURCE_MCU, SINK_SPK): #endif case PATH(SOURCE_MCU, SINK_RTX):