changeset 1031:6312f684cef1

gsm-fw feature tch-reroute: byte order changed to big endian
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 31 May 2016 18:50:32 +0000
parents 194967e11b2b
children 6e7dd5e52650
files gsm-fw/L1/cfile/tch_feature.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/L1/cfile/tch_feature.c	Tue May 31 18:39:06 2016 +0000
+++ b/gsm-fw/L1/cfile/tch_feature.c	Tue May 31 18:50:32 2016 +0000
@@ -32,8 +32,8 @@
 	*dp++ = TCH_DLBITS_IND;
 	for (i = 0; i < 20; i++) {
 		apiword = dsp_buffer[i];
+		*dp++ = apiword >> 8;
 		*dp++ = apiword;
-		*dp++ = apiword >> 8;
 	}
 	rvt_send_trace_no_cpy(buf, tch_reroute_rvt_id, 41, RVT_BINARY_FORMAT);
 }
@@ -85,7 +85,8 @@
 
 static void handle_tch_ulbits_req(T_RVT_BUFFER pkt)
 {
-	int write_ptr, write_next;
+	int write_ptr, write_next, i;
+	UINT8 *sp;
 
 	write_ptr = ul_write_ptr;
 	write_next = write_ptr + 1;
@@ -93,7 +94,11 @@
 		write_next = 0;
 	if (write_next == ul_read_ptr)	/* queue full */
 		return;
-	memcpy(uplink_data[write_ptr], pkt + 1, 34);
+	sp = pkt + 1;
+	for (i = 0; i < WORDS_PER_ENTRY; i++) {
+		uplink_data[write_ptr][i] = (sp[0] << 8) | sp[1];
+		sp += 2;
+	}
 	ul_write_ptr = write_next;
 }