{
uint8_t remBits = prbSize; /* each bit represents 6 PRBs */
uint8_t firstByte = 1;
- uint8_t numBits,startBit,byteCount = 0;
+ uint8_t numBits,startBit,byteCount = 5;
while(remBits)
{
if(startPrb/8)
{
startPrb -= 8;
- byteCount++;
+ byteCount--;
continue;
}
numBits = 8 - startBit;
/* bit operation to set the bits */
- SET_BITS((startBit % 8),numBits,freqDomain[byteCount])
+ SET_BITS_MSB((startBit % 8),numBits,freqDomain[byteCount])
firstByte = 0;
/* the ramaining bits should be subtracted with the numBits set in this byte */
remBits -= numBits;
- byteCount++;
+ byteCount--;
}
}
#define MAX_PRACH_CONFIG_IDX 256
#define MAX_MU_PUSCH 4
#define TOTAL_TBSIZE_VALUES 93
-#define SET_BITS(_startBit, _numBits, _byte) \
-{ \
- _byte = (((~((~0)<<_numBits))<<_startBit)); \
+#define SET_BITS_MSB(_startBit, _numBits, _byte) \
+{ \
+ _byte = (~((0xFF) >> _numBits)); \
+ _byte >>= _startBit; \
+}
+
+#define SET_BITS_LSB(_startBit, _numBits, _byte) \
+{ \
+ _byte = (~((0xFF) << _numBits)); \
+ _byte <<= _startBit; \
}
/* functions declarations */