|
|
@ -30,10 +30,7 @@ namespace srslte {
|
|
|
|
*****************************************************************************/
|
|
|
|
*****************************************************************************/
|
|
|
|
inline void uint8_to_uint32(uint8_t* buf, uint32_t* i)
|
|
|
|
inline void uint8_to_uint32(uint8_t* buf, uint32_t* i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
*i = (uint32_t)buf[0] << 24 |
|
|
|
|
*i = (uint32_t)buf[0] << 24 | (uint32_t)buf[1] << 16 | (uint32_t)buf[2] << 8 | (uint32_t)buf[3];
|
|
|
|
(uint32_t)buf[1] << 16 |
|
|
|
|
|
|
|
|
(uint32_t)buf[2] << 8 |
|
|
|
|
|
|
|
|
(uint32_t)buf[3];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void uint32_to_uint8(uint32_t i, uint8_t* buf)
|
|
|
|
inline void uint32_to_uint8(uint32_t i, uint8_t* buf)
|
|
|
@ -46,8 +43,7 @@ inline void uint32_to_uint8(uint32_t i, uint8_t *buf)
|
|
|
|
|
|
|
|
|
|
|
|
inline void uint8_to_uint16(uint8_t* buf, uint16_t* i)
|
|
|
|
inline void uint8_to_uint16(uint8_t* buf, uint16_t* i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
*i = (uint32_t)buf[0] << 8 |
|
|
|
|
*i = (uint32_t)buf[0] << 8 | (uint32_t)buf[1];
|
|
|
|
(uint32_t)buf[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void uint16_to_uint8(uint16_t i, uint8_t* buf)
|
|
|
|
inline void uint16_to_uint8(uint16_t i, uint8_t* buf)
|
|
|
@ -56,6 +52,17 @@ inline void uint16_to_uint8(uint16_t i, uint8_t *buf)
|
|
|
|
buf[1] = i & 0xFF;
|
|
|
|
buf[1] = i & 0xFF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void uint8_to_uint24(uint8_t* buf, uint32_t* i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
*i = (uint32_t)buf[0] << 16 | (uint32_t)buf[1] << 8 | (uint32_t)buf[2];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void uint24_to_uint8(uint32_t i, uint8_t* buf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
buf[0] = (i >> 16) & 0xFF;
|
|
|
|
|
|
|
|
buf[1] = (i >> 8) & 0xFF;
|
|
|
|
|
|
|
|
buf[2] = i & 0xFF;
|
|
|
|
|
|
|
|
}
|
|
|
|
}; //namespace
|
|
|
|
}; //namespace
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SRSLTE_INT_HELPERS_H
|
|
|
|
#endif // SRSLTE_INT_HELPERS_H
|
|
|
|