Fix: Correctly convert ARFCN to index.

If you enable PCS, you'll never make it out of power-measurement without
this patch.
This commit is contained in:
Joshua Lackey 2012-11-15 10:42:18 +01:00 committed by Andreas Eversberg
parent 5c036d5983
commit 50c3ca922b
1 changed files with 4 additions and 1 deletions

View File

@ -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];