Merge commit '1d3c49a408faa231d18d83fb03c65425cf22c507' into nanostack-libservice

* commit '1d3c49a408faa231d18d83fb03c65425cf22c507':
  Squashed 'features/FEATURE_COMMON_PAL/nanostack-libservice/' changes from 67affc61b..6444c8a4f
pull/4861/head
Seppo Takalo 2017-05-11 13:38:20 +03:00
commit bb7eecaedc
1 changed files with 16 additions and 3 deletions

View File

@ -169,6 +169,17 @@ NS_INLINE uint16_t common_read_16_bit_inverse(const uint8_t data_buf[__static 2]
*/
NS_INLINE uint_fast8_t common_count_bits(uint8_t byte);
/*
* Count leading zeros in a byte
*
* \deprecated Use common_count_leading_zeros_8
*
* \param byte byte to inspect
*
* \return number of leading zeros in byte (0-8)
*/
NS_INLINE uint_fast8_t common_count_leading_zeros(uint8_t byte);
/*
* Count leading zeros in a byte
*
@ -196,9 +207,6 @@ NS_INLINE uint_fast8_t common_count_leading_zeros_16(uint16_t value);
*/
NS_INLINE uint_fast8_t common_count_leading_zeros_32(uint32_t value);
/* Backwards compatibility */
#define common_count_leading_zeros common_count_leading_zeros_8
/*
* Compare 8-bit serial numbers
*
@ -454,6 +462,11 @@ COMMON_FUNCTIONS_FN uint_fast8_t common_count_bits(uint8_t byte)
return count;
}
COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros(uint8_t byte)
{
return common_count_leading_zeros_8(byte);
}
COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_8(uint8_t byte)
{
#ifdef __CC_ARM