From 48992ab2cfde36df5f90cbbf6a7b556308350316 Mon Sep 17 00:00:00 2001 From: Lucjan Bryndza Date: Tue, 6 May 2014 22:07:56 +0200 Subject: [PATCH] Initial class for isix driver handling --- libpsk.mk | 1 + libpsk/src/ham/ham_digi.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libpsk.mk b/libpsk.mk index df1270e..40c9a86 100644 --- a/libpsk.mk +++ b/libpsk.mk @@ -2,6 +2,7 @@ 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_CPPSRC += $(wildcard $(LIBPSK_DIR)/libpsk/src/port/isix/*.cpp) LIBPSK_INC += -I$(LIBPSK_DIR)/libpsk/include diff --git a/libpsk/src/ham/ham_digi.cpp b/libpsk/src/ham/ham_digi.cpp index ab725f2..0d797d8 100644 --- a/libpsk/src/ham/ham_digi.cpp +++ b/libpsk/src/ham/ham_digi.cpp @@ -9,7 +9,7 @@ #ifndef COMPILED_UNDER_ISIX #include "libpsk/port/pulse/pulse_device.hpp" #else -#warning not implemented yet +#include "libpsk/port/isix/stm32adac_device.hpp" #endif #include "libpsk/psk/decoder.hpp" #include "libpsk/psk/modulator.hpp" @@ -31,13 +31,13 @@ namespace { #ifndef COMPILED_UNDER_ISIX inline trx_device_base* create_default_device( ham_digi::handler_t h ) { - static const int sys_idx = ham_digi::SYS_CALLBACK_ID; + static constexpr auto sys_idx = ham_digi::SYS_CALLBACK_ID; 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 ) { - terminate(); - return nullptr; + static constexpr auto sys_idx = ham_digi::SYS_CALLBACK_ID; + return new stm32adac_device( std::bind( h, sys_idx, std::placeholders::_1 ) ); } #endif }