summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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];