From 18b4fa3b5c43db567b4b7d33b446daf622713cbd Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 19 Jul 2014 13:02:37 +0000 Subject: [PATCH] - compile clean for gcc git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@11 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- Builds/Linux/Makefile | 40 ++++++++++--- JuceLibraryCode/AppConfig.h | 4 +- .../buffers/juce_FloatVectorOperations.cpp | 22 ++++---- .../synthesisers/juce_Synthesiser.cpp | 8 +-- .../synthesisers/juce_Synthesiser.h | 8 +-- .../format_types/juce_VST3PluginFormat.cpp | 1 - .../lookandfeel/juce_LookAndFeel_V3.cpp | 4 +- .../juce_opengl/opengl/juce_OpenGLContext.cpp | 30 +++------- M-PSK Receiver.jucer | 54 +++++++++++------- Source/ControlComponent.cpp | 4 +- Source/GraphComponent.h | 2 +- Source/IQPlaneComponent.cpp | 2 +- Source/Receiver.cpp | 15 +++-- Source/Receiver.h | 56 +++++++++---------- Source/Transmitter.h | 6 +- 15 files changed, 143 insertions(+), 113 deletions(-) diff --git a/Builds/Linux/Makefile b/Builds/Linux/Makefile index 9de24cd..61bf421 100644 --- a/Builds/Linux/Makefile +++ b/Builds/Linux/Makefile @@ -18,12 +18,12 @@ ifeq ($(CONFIG),Debug) TARGET_ARCH := -march=native endif - CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 + CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "radio_float_t=float" -D "fir_float_t=float" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -I ../../../../libsrc -I ../../Source + CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 -std=c++11 CXXFLAGS += $(CFLAGS) - LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt + LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -L../../../../libsrc/radio/build/linux -L../../../../libsrc/fir/build/linux -L../../../../libsrc/crc/build/linux -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt -lradio -lfir -lcrc LDDEPS := - RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "radio_float_t=float" -D "fir_float_t=float" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -I ../../../../libsrc -I ../../Source TARGET := M-PSK\ Receiver BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) @@ -39,18 +39,22 @@ ifeq ($(CONFIG),Release) TARGET_ARCH := -march=native endif - CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -Os + CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "radio_float_t=float" -D "fir_float_t=float" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -I ../../../../libsrc -I ../../Source + CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -Os -std=c++11 CXXFLAGS += $(CFLAGS) - LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt + LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -L../../../../libsrc/radio/build/linux -L../../../../libsrc/fir/build/linux -L../../../../libsrc/crc/build/linux -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt -lradio -lfir -lcrc LDDEPS := - RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules + RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "radio_float_t=float" -D "fir_float_t=float" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -I ../../../../libsrc -I ../../Source TARGET := M-PSK\ Receiver BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) endif OBJECTS := \ + $(OBJDIR)/GraphComponent_e41edf58.o \ + $(OBJDIR)/LogComponent_246d8222.o \ + $(OBJDIR)/Receiver_5b8294f8.o \ + $(OBJDIR)/Transmitter_8ab42952.o \ $(OBJDIR)/ControlComponent_df0ca6a9.o \ $(OBJDIR)/IQPoint_361399c9.o \ $(OBJDIR)/IQPlaneComponent_22dd1f32.o \ @@ -88,6 +92,26 @@ strip: @echo Stripping M-QAM Transceiver -@strip --strip-unneeded $(OUTDIR)/$(TARGET) +$(OBJDIR)/GraphComponent_e41edf58.o: ../../Source/GraphComponent.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling GraphComponent.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/LogComponent_246d8222.o: ../../Source/LogComponent.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling LogComponent.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/Receiver_5b8294f8.o: ../../Source/Receiver.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling Receiver.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/Transmitter_8ab42952.o: ../../Source/Transmitter.cpp + -@mkdir -p $(OBJDIR) + @echo "Compiling Transmitter.cpp" + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/ControlComponent_df0ca6a9.o: ../../Source/ControlComponent.cpp -@mkdir -p $(OBJDIR) @echo "Compiling ControlComponent.cpp" diff --git a/JuceLibraryCode/AppConfig.h b/JuceLibraryCode/AppConfig.h index 8a04589..1782810 100644 --- a/JuceLibraryCode/AppConfig.h +++ b/JuceLibraryCode/AppConfig.h @@ -53,11 +53,11 @@ #endif #ifndef JUCE_ALSA - //#define JUCE_ALSA + #define JUCE_ALSA 0 #endif #ifndef JUCE_JACK - //#define JUCE_JACK + #define JUCE_JACK 1 #endif #ifndef JUCE_USE_ANDROID_OPENSLES diff --git a/JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index bc9234d..1880b27 100644 --- a/JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -53,8 +53,8 @@ namespace FloatVectorHelpers static forcedinline ParallelType load1 (Type v) noexcept { return _mm_load1_ps (&v); } static forcedinline ParallelType loadA (const Type* v) noexcept { return _mm_load_ps (v); } static forcedinline ParallelType loadU (const Type* v) noexcept { return _mm_loadu_ps (v); } - static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return _mm_store_ps (dest, a); } - static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return _mm_storeu_ps (dest, a); } + static forcedinline void storeA (Type* dest, ParallelType a) noexcept { _mm_store_ps (dest, a); } + static forcedinline void storeU (Type* dest, ParallelType a) noexcept { _mm_storeu_ps (dest, a); } static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return _mm_add_ps (a, b); } static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return _mm_sub_ps (a, b); } @@ -75,8 +75,8 @@ namespace FloatVectorHelpers static forcedinline ParallelType load1 (Type v) noexcept { return _mm_load1_pd (&v); } static forcedinline ParallelType loadA (const Type* v) noexcept { return _mm_load_pd (v); } static forcedinline ParallelType loadU (const Type* v) noexcept { return _mm_loadu_pd (v); } - static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return _mm_store_pd (dest, a); } - static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return _mm_storeu_pd (dest, a); } + static forcedinline void storeA (Type* dest, ParallelType a) noexcept { _mm_store_pd (dest, a); } + static forcedinline void storeU (Type* dest, ParallelType a) noexcept { _mm_storeu_pd (dest, a); } static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return _mm_add_pd (a, b); } static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return _mm_sub_pd (a, b); } @@ -134,8 +134,8 @@ namespace FloatVectorHelpers static forcedinline ParallelType load1 (Type v) noexcept { return vld1q_dup_f32 (&v); } static forcedinline ParallelType loadA (const Type* v) noexcept { return vld1q_f32 (v); } static forcedinline ParallelType loadU (const Type* v) noexcept { return vld1q_f32 (v); } - static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return vst1q_f32 (dest, a); } - static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return vst1q_f32 (dest, a); } + static forcedinline void storeA (Type* dest, ParallelType a) noexcept { vst1q_f32 (dest, a); } + static forcedinline void storeU (Type* dest, ParallelType a) noexcept { vst1q_f32 (dest, a); } static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return vaddq_f32 (a, b); } static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return vsubq_f32 (a, b); } @@ -156,8 +156,8 @@ namespace FloatVectorHelpers static forcedinline ParallelType load1 (Type v) noexcept { return v; } static forcedinline ParallelType loadA (const Type* v) noexcept { return *v; } static forcedinline ParallelType loadU (const Type* v) noexcept { return *v; } - static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return *dest = a; } - static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return *dest = a; } + static forcedinline void storeA (Type* dest, ParallelType a) noexcept { *dest = a; } + static forcedinline void storeU (Type* dest, ParallelType a) noexcept { *dest = a; } static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return a + b; } static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return a - b; } @@ -549,9 +549,9 @@ void FloatVectorOperations::negate (double* dest, const double* src, int num) no void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, const int* src, float multiplier, int num) noexcept { #if JUCE_USE_ARM_NEON - JUCE_PERFORM_NEON_OP_SRC_DEST (dest[i] = src[i] * multiplier, - vmulq_n_f32 (vcvtq_f32_s32 (vld1q_s32 (src)), multiplier), - JUCE_LOAD_NONE) + JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, + vmulq_n_f32 (vcvtq_f32_s32 (vld1q_s32 (src)), multiplier), + JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, ) #else JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 ((const __m128i*) src))), diff --git a/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp b/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp index 2f0b13b..7a72d00 100644 --- a/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp +++ b/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp @@ -90,10 +90,10 @@ void Synthesiser::clearVoices() voices.clear(); } -void Synthesiser::addVoice (SynthesiserVoice* const newVoice) +SynthesiserVoice* Synthesiser::addVoice (SynthesiserVoice* const newVoice) { const ScopedLock sl (lock); - voices.add (newVoice); + return voices.add (newVoice); } void Synthesiser::removeVoice (const int index) @@ -108,10 +108,10 @@ void Synthesiser::clearSounds() sounds.clear(); } -void Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) +SynthesiserSound* Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) { const ScopedLock sl (lock); - sounds.add (newSound); + return sounds.add (newSound); } void Synthesiser::removeSound (const int index) diff --git a/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index 069253b..e765697 100644 --- a/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/JuceLibraryCode/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -294,7 +294,7 @@ public: it later on when no longer needed. The caller should not retain a pointer to the voice. */ - void addVoice (SynthesiserVoice* newVoice); + SynthesiserVoice* addVoice (SynthesiserVoice* newVoice); /** Deletes one of the voices. */ void removeVoice (int index); @@ -311,10 +311,10 @@ public: /** Adds a new sound to the synthesiser. - The object passed in is reference counted, so will be deleted when it is removed - from the synthesiser, and when no voices are still using it. + The object passed in is reference counted, so will be deleted when the + synthesiser and all voices are no longer using it. */ - void addSound (const SynthesiserSound::Ptr& newSound); + SynthesiserSound* addSound (const SynthesiserSound::Ptr& newSound); /** Removes and deletes one of the sounds. */ void removeSound (int index); diff --git a/JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 537f134..4dfd4f8 100644 --- a/JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -111,7 +111,6 @@ static void createPluginDescription (PluginDescription& description, description.lastFileModTime = pluginFile.getLastModificationTime(); description.manufacturerName = company; description.name = name; - description.descriptiveName = name; description.pluginFormatName = "VST3"; description.numInputChannels = numInputs; description.numOutputChannels = numOutputs; diff --git a/JuceLibraryCode/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp b/JuceLibraryCode/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp index e64288e..9263072 100644 --- a/JuceLibraryCode/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp +++ b/JuceLibraryCode/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp @@ -30,8 +30,8 @@ LookAndFeel_V3::LookAndFeel_V3() setColour (TextButton::buttonColourId, textButtonColour); setColour (ComboBox::buttonColourId, textButtonColour); setColour (TextEditor::outlineColourId, Colours::transparentBlack); - setColour (TabbedButtonBar::tabOutlineColourId, Colour (0x66000000)); - setColour (TabbedComponent::outlineColourId, Colour (0x66000000)); + setColour (TabbedButtonBar::tabOutlineColourId, Colour (0xff999999)); + setColour (TabbedComponent::outlineColourId, Colour (0xff999999)); setColour (Slider::trackColourId, Colour (0xbbffffff)); setColour (Slider::thumbColourId, Colour (0xffddddff)); setColour (BubbleComponent::backgroundColourId, Colour (0xeeeeeedd)); diff --git a/JuceLibraryCode/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/JuceLibraryCode/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 27faff4..45c99ae 100644 --- a/JuceLibraryCode/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/JuceLibraryCode/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -145,6 +145,11 @@ public: { ScopedPointer mmLock; + const Rectangle screenBounds (component.getTopLevelComponent()->getScreenBounds()); + + if (lastScreenBounds != screenBounds) + updateViewportSize (false); + const bool isUpdating = needsUpdate.compareAndSetBool (0, 1); if (context.renderComponents && isUpdating) @@ -156,8 +161,6 @@ public: mmLock = new MessageManagerLock (this); // need to acquire this before locking the context. if (! mmLock->lockWasGained()) return false; - - updateViewportSize (false); } if (! context.makeActive()) @@ -216,19 +219,13 @@ public: } } - void checkViewportBounds() - { - const Rectangle screenBounds (component.getTopLevelComponent()->getScreenBounds()); - - if (lastScreenBounds != screenBounds) - updateViewportSize (true); - } - void paintComponent() { // you mustn't set your own cached image object when attaching a GL context! jassert (get (component) == this); + updateViewportSize (false); + if (! ensureFrameBufferSize()) return; @@ -466,8 +463,7 @@ void OpenGLContext::NativeContext::renderCallback() #endif //============================================================================== -class OpenGLContext::Attachment : public ComponentMovementWatcher, - private Timer +class OpenGLContext::Attachment : public ComponentMovementWatcher { public: Attachment (OpenGLContext& c, Component& comp) @@ -568,14 +564,10 @@ private: comp.setCachedComponentImage (newCachedImage); newCachedImage->start(); // (must wait until this is attached before starting its thread) newCachedImage->updateViewportSize (true); - - startTimer (400); } void detach() { - stopTimer(); - Component& comp = *getComponent(); #if JUCE_MAC @@ -588,12 +580,6 @@ private: comp.setCachedComponentImage (nullptr); context.nativeContext = nullptr; } - - void timerCallback() override - { - if (CachedImage* const cachedImage = CachedImage::get (*getComponent())) - cachedImage->checkViewportBounds(); - } }; //============================================================================== diff --git a/M-PSK Receiver.jucer b/M-PSK Receiver.jucer index 6d1b4e8..ac3601c 100644 --- a/M-PSK Receiver.jucer +++ b/M-PSK Receiver.jucer @@ -6,6 +6,17 @@ companyEmail="jens@jayfield.org"> + + + + + + + + - + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -64,5 +78,5 @@ - + diff --git a/Source/ControlComponent.cpp b/Source/ControlComponent.cpp index a24a301..5d5d40f 100644 --- a/Source/ControlComponent.cpp +++ b/Source/ControlComponent.cpp @@ -2104,8 +2104,8 @@ BEGIN_JUCER_METADATA virtualName="" explicitFocusOrder="0" pos="720 408 64 24" buttonText="Reset" connectedEdges="0" needsCallback="1" radioGroupId="0"/> #include "Receiver.h" //[/Headers] diff --git a/Source/IQPlaneComponent.cpp b/Source/IQPlaneComponent.cpp index f800f92..73be591 100644 --- a/Source/IQPlaneComponent.cpp +++ b/Source/IQPlaneComponent.cpp @@ -149,7 +149,7 @@ void IQPlaneComponent::pointAdd(sym_err_t *pPoint, uint32_t numPoints) if (m_numPoints >= m_maxNumPoints) return; - numFill = (uint32_t)__min(m_maxNumPoints-m_numPoints, numPoints); + numFill = (uint32_t)dmin(m_maxNumPoints-m_numPoints, numPoints); for (i=0; i < numFill; i++) { m_pPointArray[m_numPoints++] = pPoint[i]; diff --git a/Source/Receiver.cpp b/Source/Receiver.cpp index d4b0203..5ea3501 100644 --- a/Source/Receiver.cpp +++ b/Source/Receiver.cpp @@ -1,9 +1,12 @@ #include #include "Receiver.h" #include "MinMaxLemire.h" -#include "Frame.hpp" +#include + +#if 0 #include #include +#endif /***************************************************************/ const uint32_t LPF_OVERSAMPLING = 32; // Arm-Filter: oversampling @@ -161,6 +164,7 @@ void Receiver::initDefaultParams() m_params.eqMuDfe = DFE_MU; } +#if 0 void UpdateWeigths(ComplexVector &x, ComplexVector &e, ComplexVector &w, ComplexVector &w_conj, radio_float_t mu) { @@ -174,6 +178,7 @@ void UpdateWeigths(ComplexVector &x, ComplexVector &e, ComplexVector &w, Complex w_conj.print("w*"); } +#endif void Receiver::init() { @@ -364,7 +369,6 @@ void Receiver::init() UnitFrameTransmitter tx(10, &rx); tx.process(); -#endif //--------------------------- // ComplexVector //--------------------------- @@ -820,6 +824,7 @@ void Receiver::init() rv1.print("v1"); rv2.print("v2"); rv3.print("v3"); +#endif TraceOpen(&m_trace, "D:\\home\\jens\\Dokumente\\trace.txt"); @@ -1312,7 +1317,7 @@ cpx_t Receiver::processMatchedFilter(cpx_t x, int32_t m, radio_float_t mu) return y; } -int Receiver::Farrow_open_coeff(ppip_farrow_cpx_t *pObj, char *filename) +int Receiver::Farrow_open_coeff(ppip_farrow_cpx_t *pObj, const char *filename) { int i; FILE *pFile; @@ -1440,7 +1445,7 @@ void Receiver::initFilterRcf() } m_pFarrowInterpolator = new ppip_farrow_cpx_t(); - Farrow_open_coeff(m_pFarrowInterpolator, "D:\\home\\jens\\work\\develope\\win32\\Projects\\radio\\farrow_coeff.dat"); + Farrow_open_coeff(m_pFarrowInterpolator, "/home/jens/farrow_coeff.dat"); m_log.log("Farrow filter coefficients loaded (L=%d, M=%d, N=%d)", m_pFarrowInterpolator->L, m_pFarrowInterpolator->M, m_pFarrowInterpolator->N); } @@ -1502,6 +1507,8 @@ void Receiver::setSamplerate(float samplerate_hz) const ScopedLock sl (m_lock); m_params.samplerate = samplerate_hz; + m_params.symbolrate = samplerate_hz/4; + m_params.ddc_freq = samplerate_hz/4; initDDC(); initFilterArm(); diff --git a/Source/Receiver.h b/Source/Receiver.h index 90578a5..1bc4bbb 100644 --- a/Source/Receiver.h +++ b/Source/Receiver.h @@ -9,10 +9,10 @@ #include #include #include +#include #include "JuceHeader.h" -#include "Logcomponent.h" -#include "Frame.hpp" +#include "LogComponent.h" // --------------------------------------------------- #define NUM_PASSBAND_SAMPLES_PER_SYM 4 @@ -160,13 +160,13 @@ typedef struct _params_t bool strAutoControlEnable; bool cprAutoControlEnable; bool agcAutoControlEnable; - str_mode str_mode; - cpr_mode cpr_mode; - agc_mode agc_mode; - eq_mode eq_mode; - cma_type cmaType; - cma_mode cmaMode; - dfe_mode dfeMode; + enum str_mode str_mode; + enum cpr_mode cpr_mode; + enum agc_mode agc_mode; + enum eq_mode eq_mode; + enum cma_type cmaType; + enum cma_mode cmaMode; + enum dfe_mode dfeMode; lead_lag_coeff_t str_loopfilter_coeff[2]; uint32_t str_loopfilter_coeff_index; lead_lag_coeff_t cpr_loopfilter_coeff[2]; @@ -177,9 +177,9 @@ typedef struct _params_t float agcMu[2]; uint32_t agcMu_index; - str_state strState; - cpr_state cprState; - agc_state agc_state; + enum str_state strState; + enum cpr_state cprState; + enum agc_state agc_state; } params_t; @@ -292,7 +292,7 @@ private: uint32_t m_numSymsInBuffer; uint32_t m_bufsize; bool m_ReceiverEnable; - clock_t m_symClock; + sample_clock_t m_symClock; pfd_t m_pfdCpr; cpx_t m_trackers_[4]; cpx_t m_trackers[4]; @@ -354,7 +354,7 @@ private: void timerCallback(); void processBaseband(cpx_t *pIF, uint32_t len); cpx_t processMatchedFilter(cpx_t x, int32_t m, radio_float_t mu); - int Farrow_open_coeff(ppip_farrow_cpx_t *pObj, char *filename); + int Farrow_open_coeff(ppip_farrow_cpx_t *pObj, const char *filename); void minMaxInit(minmax_t *pObj, radio_float_t min_initial, radio_float_t max_initial) { pObj->min = min_initial; @@ -402,19 +402,19 @@ private: void initDDC(); // Interface - void Receiver::setSamplerate(float samplerate_hz) override; - void Receiver::setParams(const params_t ¶ms) override; - params_t& Receiver::getParams() override; - status_t& Receiver::getStatus() override; - void Receiver::reset() override; - void Receiver::strReset() override; - void Receiver::cprReset() override; - void Receiver::dfeReset() override; - void Receiver::cmaReset() override; - void Receiver::statisticsReset() override; - void Receiver::dfeOffUpdateFromCma() override; - void Receiver::dfeOnUpdateFromDfeOff() override; - cpx_t& Receiver::getTracker(uint32 index) override; + void setSamplerate(float samplerate_hz) override; + void setParams(const params_t ¶ms) override; + params_t& getParams() override; + status_t& getStatus() override; + void reset() override; + void strReset() override; + void cprReset() override; + void dfeReset() override; + void cmaReset() override; + void statisticsReset() override; + void dfeOffUpdateFromCma() override; + void dfeOnUpdateFromDfeOff() override; + cpx_t& getTracker(uint32 index) override; void onData(void *pData, uint32_t size) override { @@ -447,4 +447,4 @@ private: trace_t m_trace; }; -#endif // _RECEIVER_H_ \ No newline at end of file +#endif // _RECEIVER_H_ diff --git a/Source/Transmitter.h b/Source/Transmitter.h index b47beff..8674e76 100644 --- a/Source/Transmitter.h +++ b/Source/Transmitter.h @@ -5,10 +5,10 @@ #include #include #include +#include #include "JuceHeader.h" -#include "Logcomponent.h" -#include "Frame.hpp" +#include "LogComponent.h" #define TRANSMITTER_RCF_OVERSAMPLING ((uint32_t)32) #define TRANSMITTER_RCF_ROLLOFF ((radio_float_t)0.35) @@ -248,4 +248,4 @@ private: } }; -#endif // _TRANSMITTER_H_ \ No newline at end of file +#endif // _TRANSMITTER_H_