WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
wlan_util_common.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2021. All rights reserved.
3 * Description: oam log printing interface
4 */
5
6#ifndef __WLAN_UTIL_COMMON_H__
7#define __WLAN_UTIL_COMMON_H__
8
10
11#ifdef __cplusplus
12#if __cplusplus
13extern "C" {
14#endif
15#endif
16
17/* ****************************************************************************
18 函 数 名 : oal_bit_get_num_one_byte
19 功能描述 : 获取单字节中的bit1的个数
20**************************************************************************** */
21static inline osal_u8 oal_bit_get_num_one_byte(osal_u8 byte)
22{
23 osal_u8 byte_data = byte;
24
25 byte_data = (byte_data & 0x55) + ((byte_data >> 1) & 0x55); /* 0x55掩码, 1移位数 */
26 byte_data = (byte_data & 0x33) + ((byte_data >> 2) & 0x33); /* 0x33掩码, 2移位数 */
27 byte_data = (byte_data & 0x0F) + ((byte_data >> 4) & 0x0F); /* 0x0F掩码, 4移位数 */
28
29 return byte_data;
30}
31
32#ifdef __cplusplus
33#if __cplusplus
34}
35#endif
36#endif
37
38#endif /* end of wlan_util_common.h */
unsigned char osal_u8
Definition osal_types.h:11