HackRF: fix hackrf_source signedness

The LUT changes in 2e7d343fed inadvertently started interpreting samples
as unsigned. This change puts it back to signed (and fixes an outdated
comment).

Signed-off-by: Eric Wild <ewild@sysmocom.de>
This commit is contained in:
Mike Walters 2020-08-05 21:06:25 +01:00 committed by Eric Wild
parent 911082ff85
commit bd668e97b6
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@
#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
#define BUF_NUM 15
#define BYTES_PER_SAMPLE 2 /* HackRF device produces/consumes 8 bit unsigned IQ data */
#define BYTES_PER_SAMPLE 2 /* HackRF device produces/consumes 8 bit signed IQ data */
#define HACKRF_FORMAT_ERROR(ret, msg) \
boost::str( boost::format(msg " (%1%) %2%") \

View File

@ -88,7 +88,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
// create a lookup table for gr_complex values
for (unsigned int i = 0; i <= 0xff; i++) {
_lut.push_back( float(i) * (1.0f/128.0f) );
_lut.push_back( float(int8_t(i)) * (1.0f/128.0f) );
}
if ( BUF_NUM != _buf_num || BUF_LEN != _buf_len ) {