From eb11b05298dde8df750e903fe7d791050666278d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 15 Nov 2011 09:32:05 -0800 Subject: convert: added generic conversion for sc8 wire -> sc8 host --- host/lib/convert/convert_common.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'host/lib/convert/convert_common.hpp') diff --git a/host/lib/convert/convert_common.hpp b/host/lib/convert/convert_common.hpp index cc287114a..699d6301b 100644 --- a/host/lib/convert/convert_common.hpp +++ b/host/lib/convert/convert_common.hpp @@ -134,6 +134,20 @@ static UHD_INLINE fc64_t item32_sc16_to_fc64(item32_t item, double scale_factor) ); } +/*********************************************************************** + * Convert items32 sc8 buffer to complex char + **********************************************************************/ +static UHD_INLINE void item32_sc8_to_sc8(item32_t item, sc8_t &out0, sc8_t &out1, double){ + out0 = sc8_t( + boost::int8_t(item >> 8), + boost::int8_t(item >> 0) + ); + out1 = sc8_t( + boost::int8_t(item >> 24), + boost::int8_t(item >> 16) + ); +} + /*********************************************************************** * Convert items32 sc8 buffer to complex short **********************************************************************/ -- cgit v1.2.3