File: 0049-Adapt-code-to-signed-samples.patch

package info (click to toggle)
hackrf 2015.07.2-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,764 kB
  • ctags: 9,327
  • sloc: ansic: 13,907; python: 696; vhdl: 218; sh: 32; makefile: 15
file content (23 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 6f9e7fdab838ab3ec0a20410c5c9d4373e6603a4 Mon Sep 17 00:00:00 2001
From: Jared Boone <jboone@earfeast.com>
Date: Sat, 15 Aug 2015 10:03:12 -0700
Subject: [PATCH 49/68] Adapt code to signed samples.

Necessary due to change in CPLD to produce signed samples.
---
 firmware/sgpio-rx/sgpio-rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/firmware/sgpio-rx/sgpio-rx.c
+++ b/firmware/sgpio-rx/sgpio-rx.c
@@ -66,8 +66,8 @@
         buffer[i & 4095] = SGPIO_REG_SS(SGPIO_SLICE_A);
 
 		/* find the magnitude squared */
-		sigi = (buffer[i & 4095] & 0xff) - 0x80;
-		sigq = ((buffer[i & 4095] >> 8) & 0xff) - 0x80;
+		sigi = buffer[i & 4095] & 0xff;
+		sigq = (buffer[i & 4095] >> 8) & 0xff;
 		magsq = sigi * sigq;
 		if ((uint16_t)magsq & 0x8000) {
 			magsq ^= 0xffff;