From 3469feb065900c7d4232a23bae8ef616a5de07cb Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Sat, 26 Oct 2024 12:45:20 +0200 Subject: [PATCH] MD-UV3x0: using HR_C6000 DAC for "beep" tones --- meson.build | 1 + platform/targets/MD-UV3x0/platform.c | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 2662bbea..8e6d48bd 100644 --- a/meson.build +++ b/meson.build @@ -82,6 +82,7 @@ openrtx_inc = ['openrtx/include', 'platform/drivers/USB', 'platform/drivers/GPIO', 'platform/drivers/tones', + 'platform/drivers/audio', 'platform/drivers/baseband', 'platform/drivers/backlight', 'platform/drivers/chSelector'] diff --git a/platform/targets/MD-UV3x0/platform.c b/platform/targets/MD-UV3x0/platform.c index b6628536..c386ac1b 100644 --- a/platform/targets/MD-UV3x0/platform.c +++ b/platform/targets/MD-UV3x0/platform.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef CONFIG_SCREEN_BRIGHTNESS #include @@ -190,20 +191,12 @@ void platform_ledOff(led_t led) void platform_beepStart(uint16_t freq) { - // calculate appropriate volume. - uint8_t vol = platform_getVolumeLevel(); - // Since beeps have been requested, we do not want to have 0 volume. - // We also do not want the volume to be excessive. - if (vol < 10) - vol = 5; - if (vol > 176) - vol = 176; - toneGen_beepOn((float)freq, vol, 0); + Cx000dac_startBeep(freq); } void platform_beepStop() { - toneGen_beepOff(); + Cx000dac_stopBeep(); } datetime_t platform_getCurrentTime()