From: Nathael Pajani Date: Mon, 26 Sep 2016 16:01:56 +0000 (+0200) Subject: Adding bits_set() to header file X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=beb8a1bc9e4bca9eb8e661c9c4d1ab32d1d6fd8f;p=soft%2Flpc82x%2Fcore Adding bits_set() to header file --- diff --git a/include/lib/utils.h b/include/lib/utils.h index 838e24d..e8ffac2 100644 --- a/include/lib/utils.h +++ b/include/lib/utils.h @@ -48,5 +48,11 @@ uint8_t clz(uint32_t x); */ uint8_t ctz(uint32_t x); +/* + * Count bits set + */ +uint8_t bits_set(uint32_t x); + + #endif /* LIB_UTILS_H */ diff --git a/lib/utils.c b/lib/utils.c index c6899eb..cb9f354 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -83,8 +83,10 @@ uint8_t ctz(uint32_t x) return r + bval_ctz[(x & 0x0F)]; } -/* Count bits set - * + + +/* + * Count bits set */ uint8_t bits_set(uint32_t x) {