*(volatile pointer*) kernel_data = (pointer) & _mqx_version_number; | |
*(volatile pointer*) kernel_data = (pointer) & _mqx_vendor; |
does the code equal follows?
*(volatile pointer*) kernel_data = (pointer) & _mqx_vendor;
the code *(volatile pointer*) kernel_data = (pointer) & _mqx_version_number; doesn't used?
上面
两句连着的代码,什么意思,左边的地址是一样的。是不是代表两句话只有最后一句代码是有效的?。求解释?
Hello Li,
Not certain of your question.
In the mqx.c source code the preceding comment is:
/* The following assignments are done to force the linker to include
* the symbols, which are required by TAD.
* Note that we should use address of the variable so it is not optimized
* as direct constant assignment when optimization level is high.
* Note that counter will be immediately reset to zero on the subsequent
* _mem_zero call. */
I interpret the comment to be a workaround to some issue.
Regards,
David