diff --git a/.hgignore b/.hgignore index 37fc526..0e46ad2 100644 --- a/.hgignore +++ b/.hgignore @@ -5,3 +5,4 @@ syntax: glob *.orig *.elf .* +*.a diff --git a/libpsk.mk b/libpsk.mk new file mode 100644 index 0000000..df1270e --- /dev/null +++ b/libpsk.mk @@ -0,0 +1,18 @@ +#PSK lib isix header +LIBPSK_CPPSRC += $(wildcard $(LIBPSK_DIR)/libpsk/src/codec/*.cpp) +LIBPSK_CPPSRC += $(wildcard $(LIBPSK_DIR)/libpsk/src/ham/*.cpp) +LIBPSK_CPPSRC += $(wildcard $(LIBPSK_DIR)/libpsk/src/psk/*.cpp) +LIBPSK_INC += -I$(LIBPSK_DIR)/libpsk/include + + +LIBPSK_LIB += $(LIBPSK_DIR)/libpsk.a +LIBPSK_OBJS += $(LIBPSK_CPPSRC:%.cpp=%.o) +DEPFILES += $(LIBPSK_CPPSRC:%.cpp=%.dep) + +.ONESHELL: +$(LIBPSK_LIB): $(LIBPSK_OBJS) + $(AR) $(ARFLAGS) $@ $^ + +LIBS += $(LIBPSK_LIB) +LIBS_OBJS += $(LIBPSK_OBJS) +COMMON_FLAGS += $(LIBPSK_INC) -D_GLIBCXX_USE_C99_MATH_TR1 diff --git a/libpsk/include/dsp/fft.h b/libpsk/include/dsp/fft.h index b71df63..f07bd1d 100644 --- a/libpsk/include/dsp/fft.h +++ b/libpsk/include/dsp/fft.h @@ -79,11 +79,12 @@ namespace _internal } #else //TODO: Cortex M3 biteverse use RBIT AND ASR in CM3 - inline unsigned bitrev( unsigned v, int m ) + inline unsigned bitrev( unsigned value, int m ) { - + unsigned result; + asm ("rbit %0, %1" : "=r" (result) : "r" (value) ); + return result >> ( 32 - m ); } - #error Bit reverse not implemented yet #endif //Constant class definition template class scaledV diff --git a/libpsk/include/psk/spectrum_calculator.hpp b/libpsk/include/psk/spectrum_calculator.hpp index 764b1af..8264423 100644 --- a/libpsk/include/psk/spectrum_calculator.hpp +++ b/libpsk/include/psk/spectrum_calculator.hpp @@ -8,6 +8,7 @@ #ifndef LIBPSK_SPECTRUM_CALCULATOR_HPP_ #define LIBPSK_SPECTRUM_CALCULATOR_HPP_ /*----------------------------------------------------------*/ +#include #include #include #include @@ -15,7 +16,6 @@ /*----------------------------------------------------------*/ namespace ham { namespace psk { - /*----------------------------------------------------------*/ //Class spectrum calculator calculate the current spectrum class spectrum_calculator { diff --git a/libpsk/src/ham/ham_digi.cpp b/libpsk/src/ham/ham_digi.cpp index 408fec0..63533d6 100644 --- a/libpsk/src/ham/ham_digi.cpp +++ b/libpsk/src/ham/ham_digi.cpp @@ -9,7 +9,7 @@ #ifndef COMPILED_UNDER_ISIX #include "port/pulse/pulse_device.hpp" #else -#error not implemented yet +#warning not implemented yet #endif #include "psk/decoder.hpp" #include "psk/modulator.hpp" @@ -28,6 +28,10 @@ namespace return new pulse_device( std::bind(h, sys_idx, std::placeholders::_1) ); } #else + inline trx_device_base* create_default_device( ham_digi::handler_t h ) { + return nullptr; + return nullptr; + } #endif } /* ------------------------------------------------------------------------- */ diff --git a/unix.mk b/unix.mk index d58d493..0bfa9d9 100644 --- a/unix.mk +++ b/unix.mk @@ -9,8 +9,6 @@ CP = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump SIZE = $(CROSS_COMPILE)size -#Current platform -PLATFORM_DEVICE ?= BFC1 #Pozostale ustawienia kompilatora ASFLAGS += @@ -42,11 +40,6 @@ CXXFLAGS += -ffunction-sections -fdata-sections LDFLAGS+= -Wl,--gc-sections endif -ifeq ($(PLATFORM_DEVICE), BF210) -CFLAGS += -DPLCXML_BF210_PLATFORM -CXXFLAGS += -DPLCXML_BF210_PLATFORM -endif - all: build