#define GET_BIT(x, bit) ((x & (1 << bit)) >> bit)//提取第bit位(二进制数)
uint8_t a = 0b10101010100uint8_t b = GET_BIT(a,2);//提取a这个变量的第2个值b = 1
posted on 2023-04-03 11:06 虎啸岳林 阅读(19) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 虎啸岳林 Powered by .NET 8.0 on Kubernetes