From 42e75212054dddb6de50e9003cbeb068c130e22e Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Wed, 6 Oct 2021 21:43:07 +0200 Subject: [PATCH] Fixed compilation error with GDx targets Added codec2 as a dependency also for GD77, DM1801 and MD9600 targets to allow compilation of OpMode_17.cpp file Stub input audio stream driver for GDx targets --- meson.build | 6 ++- openrtx/include/ui.h | 4 +- openrtx/src/threads.c | 2 +- platform/drivers/audio/inputStream_GDx.c | 55 ++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 platform/drivers/audio/inputStream_GDx.c diff --git a/meson.build b/meson.build index 78c20976..598d041e 100644 --- a/meson.build +++ b/meson.build @@ -137,7 +137,8 @@ gdx_src = ['platform/drivers/NVM/W25Qx.c', 'platform/drivers/baseband/HR_C6000_GDx.cpp', 'platform/drivers/display/UC1701_GDx.c', 'platform/drivers/keyboard/keyboard_GDx.c', - 'platform/drivers/audio/audio_GDx.c'] + 'platform/drivers/audio/audio_GDx.c', + 'platform/drivers/audio/inputStream_GDx.c'] ## ## --------------------- MCU-dependent source files ---------------------------- @@ -399,6 +400,7 @@ gd77_opts = {'sources': gd77_src, 'cpp_args': gd77_args, 'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld', '-Wl,--print-memory-usage'], + 'dependencies': [codec2_dep], 'include_directories':gd77_inc} dm1801_opts = {'sources': dm1801_src, @@ -406,6 +408,7 @@ dm1801_opts = {'sources': dm1801_src, 'cpp_args': dm1801_args, 'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld', '-Wl,--print-memory-usage'], + 'dependencies': [codec2_dep], 'include_directories':dm1801_inc} md9600_opts = {'sources': md9600_src, @@ -413,6 +416,7 @@ md9600_opts = {'sources': md9600_src, 'cpp_args': md9600_args, 'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld', '-Wl,--print-memory-usage'], + 'dependencies': [codec2_dep], 'include_directories': md9600_inc} ## diff --git a/openrtx/include/ui.h b/openrtx/include/ui.h index a6d7cdf3..2322bb2e 100644 --- a/openrtx/include/ui.h +++ b/openrtx/include/ui.h @@ -81,9 +81,9 @@ enum menuItems enum settingsItems { - S_DISPLAY = 0, + S_DISPLAY = 0 #ifdef HAS_RTC - S_TIMEDATE + ,S_TIMEDATE #endif #ifdef HAS_GPS ,S_GPS diff --git a/openrtx/src/threads.c b/openrtx/src/threads.c index 4d40f1d9..9487ed04 100644 --- a/openrtx/src/threads.c +++ b/openrtx/src/threads.c @@ -33,9 +33,9 @@ #include #include #include +#include #ifdef HAS_GPS #include -#include #include #endif diff --git a/platform/drivers/audio/inputStream_GDx.c b/platform/drivers/audio/inputStream_GDx.c new file mode 100644 index 00000000..d34467c4 --- /dev/null +++ b/platform/drivers/audio/inputStream_GDx.c @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2021 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see * + ***************************************************************************/ + +#include +#include +#include + +streamId inputStream_start(const enum AudioSource source, + const enum AudioPriority prio, + stream_sample_t * const buf, + const size_t bufLength, + const enum BufMode mode, + const uint32_t sampleRate) +{ + (void) source; + (void) prio; + (void) buf; + (void) bufLength; + (void) mode; + (void) sampleRate; + + return -1; +} + +dataBlock_t inputStream_getData(streamId id) +{ + (void) id; + + dataBlock_t block; + block.data = NULL; + block.len = 0; + return block; +} + +void inputStream_stop(streamId id) +{ + (void) id; +}