This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
1、在读取ADC转换结果中,把ADCH放到 int16 reading变量的高八位是这样做的:
我的问题是:
ADCH相当于是一个字节(8bits)的变量,先是左移8位后,值变成了0x00(16进制),然后在进行(int16)强制转换,高位用0补充,值变成了0x0000(16进制),那么reading的高八位不就是0x00(16进制)吗?怎么就实现了ADCH的值赋给了reading的高八位?
2、直接上图:
我的问题是:
对于这句 (uint8 *)pAttr->pValue; 我是这样理解的。先将 结构体指针变量pAttr 强制转换成 无符号字符型指针,然后pAttr是无符号字符型变量指针了,怎么能指向结构体成员pValue?