summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lackey <jl@thre.at>2012-11-15 10:42:18 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2012-11-15 10:42:18 +0100
commit50c3ca922b3d43f33f4e550e7a47b09af6dffc24 (patch)
treee7fdee9c37aa66aad9556676e95ecf66111d8db5
parent5c036d59831d013099ba6f750c25018f4bc3bef9 (diff)
Fix: Correctly convert ARFCN to index.
If you enable PCS, you'll never make it out of power-measurement without this patch.
-rw-r--r--src/host/layer23/src/mobile/gsm322.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index ce5e1e1d..ffecfc37 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -300,11 +300,14 @@ uint16_t index2arfcn(int index)
int arfcn2index(uint16_t arfcn)
{
- if ((arfcn & ARFCN_PCS) && arfcn >= 512 && arfcn <= 810)
+ int is_pcs = arfcn & ARFCN_PCS;
+ arfcn &= ~ARFCN_FLAG_MASK;
+ if ((is_pcs) && (arfcn >= 512) && (arfcn <= 810))
return (arfcn & 1023)-512+1024;
return arfcn & 1023;
}
+
static char *bargraph(int value, int min, int max)
{
static char bar[128];